First of all, thank you very much for creating and maintaining this module — the idea of exposing Odoo's AI tools through a clean, decorator-based schema is really nice, and it made it very easy for me to get started.
While trying to connect ai_oca_mcp to an MCP client (Claude Code), I ran into an issue and I think I've traced it to the following, but please correct me if I'm misunderstanding something.
What I observed:
AiTool._ai_get_date declares its output_schema like this:
@aitool(
input_schema={},
output_schema={
"date": {"type": "date"},
},
)
def _ai_get_date(self):
return {"date": date.today().isoformat()}
As far as I understand the JSON Schema spec, "date" isn't one of the valid values for the type keyword (it should be string/number/integer/boolean/object/array/null, with format: "date" used on top of string to express a date). If that's correct, this schema may not be strictly valid JSON Schema.
Why I noticed it:
I was trying out ai_oca_mcp by connecting it to an MCP client (Claude Code) as a quick test, using the demo get_date tool. The connection kept failing with a schema-related error. After poking around a bit, changing this type value to string (with format: "date") made the connection work fine. So it's possible this is just how my particular client happens to behave, but wanted to flag it in case it's a genuine issue.
Possible fix (happy to send a PR if useful):
output_schema={
"date": {"type": "string", "format": "date"},
},
Thanks again for the module — let me know if I'm off base here, or if there's a reason it's written this way that I'm missing!
@qrtl
First of all, thank you very much for creating and maintaining this module — the idea of exposing Odoo's AI tools through a clean, decorator-based schema is really nice, and it made it very easy for me to get started.
While trying to connect ai_oca_mcp to an MCP client (Claude Code), I ran into an issue and I think I've traced it to the following, but please correct me if I'm misunderstanding something.
What I observed:
AiTool._ai_get_date declares its output_schema like this:
@aitool(
input_schema={},
output_schema={
"date": {"type": "date"},
},
)
def _ai_get_date(self):
return {"date": date.today().isoformat()}
As far as I understand the JSON Schema spec, "date" isn't one of the valid values for the type keyword (it should be string/number/integer/boolean/object/array/null, with format: "date" used on top of string to express a date). If that's correct, this schema may not be strictly valid JSON Schema.
Why I noticed it:
I was trying out ai_oca_mcp by connecting it to an MCP client (Claude Code) as a quick test, using the demo get_date tool. The connection kept failing with a schema-related error. After poking around a bit, changing this type value to string (with format: "date") made the connection work fine. So it's possible this is just how my particular client happens to behave, but wanted to flag it in case it's a genuine issue.
Possible fix (happy to send a PR if useful):
output_schema={
"date": {"type": "string", "format": "date"},
},
Thanks again for the module — let me know if I'm off base here, or if there's a reason it's written this way that I'm missing!
@qrtl