davsclaus opened a new pull request, #23865:
URL: https://github.com/apache/camel/pull/23865

   ## Summary
   
   - Add structured parameter metadata (name, type, required/optional, 
defaults, descriptions) and usage examples to all ~90 Simple language functions 
in the catalog
   - The generated `simple.json` now includes `params` and `examples` arrays 
for each function, enabling AI agents and MCP tools to fully understand 
function signatures
   - Expose function metadata through the MCP `camel_catalog_language_doc` tool 
(previously returned zero function information)
   
   ### Changes
   
   **Annotation layer:**
   - Add `examples()` field to `@Metadata` annotation (both 
`tooling/spi-annotations` and `core/camel-api` generated copy)
   
   **Tooling model:**
   - Add `FunctionParamModel` class to `LanguageModel` with name, javaType, 
required, defaultValue, description
   - Add `params` and `examples` fields to `LanguageFunctionModel`
   - Serialize/deserialize in `JsonMapper`
   
   **Build plugin:**
   - Parse `param=name:type:required|optional:default:description` entries from 
`@Metadata.annotations()`
   - Parse `@Metadata.examples()` into the model
   
   **Simple language:**
   - Enrich 90 functions with structured param annotations and 87 with usage 
examples in `SimpleConstants.java`
   
   **MCP:**
   - Add `FunctionInfo` and `FunctionParamInfo` records to `CatalogTools`
   - Add `functions` field to `LanguageDetailResult` so 
`camel_catalog_language_doc("simple")` returns the full function catalog
   
   ### Example generated JSON
   
   ```json
   "abs(exp)": {
     "kind": "function",
     "displayName": "Absolute Number",
     "group": "number",
     "javaType": "Long",
     "description": "Converts the message body (or expression) to a long 
number...",
     "params": [{
       "name": "exp",
       "javaType": "Object",
       "required": false,
       "defaultValue": "body",
       "description": "The expression. When omitted uses the message body"
     }],
     "examples": [
       "${abs(-5)} -> 5",
       "${abs(${header.price})} -> 42 // when header price is -42"
     ]
   }
   ```
   
   ## Test plan
   
   - [x] Build chain passes: spi-annotations → camel-tooling-model → 
camel-package-maven-plugin → camel-core-languages → camel-jbang-mcp
   - [x] Generated `simple.json` contains params and examples for enriched 
functions
   - [x] MCP `LanguageDetailResult` includes `functions` field with params and 
examples
   - [ ] CI build passes
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to