davsclaus opened a new pull request, #26352: URL: https://github.com/apache/camel/pull/26352
Resolves [CAMEL-24695](https://issues.apache.org/jira/browse/CAMEL-24695) One neutral set of Camel authoring tools for AI agents, defined once in the shared `ToolRegistry` in camel-jbang-core and exposed under the same `camel_` names by both MCP servers, `camel mcp` and `camel tui --mcp`, so an agent gets the same Camel through either door. ### The shared set (`AuthoringTools` in camel-jbang-core) | Tool | What it does | |---|---| | `camel_catalog_doc` | catalog doc of a component/dataformat/language/EIP with the URI rules and the simple syntax, functions and operators; `endpoint` checks a URI | | `camel_catalog_find` | components, data formats and languages by protocol/product term (CAMEL-24658 matcher) | | `camel_validate_source` | YAML DSL schema, endpoint URIs, simple expressions, `camel.*` properties, messages by line | | `camel_get_files` / `camel_write_file` | list/read/write the source files of a project directory; a write is validated first and refused when invalid; plain file names only | | `camel_run` | `camel run --dev` in a separate process through the CLI launcher, returns pid and log once the status file appears | | `camel_control` | stop, kill, restart (relaunch with the process' own command line), stop-routes, start-routes, reset-stats | | `camel_get_log` | tail of `~/.camel/<pid>.log` as records (a stack trace is one record with a detail block) | | `camel_get_errors` | the error file of the integration | | `camel_eval_expression` | in the running integration when one is selected or named, otherwise **locally** in a scratch CamelContext (new for both doors) | | `camel_error_diagnose` | the diagnose table (moved from camel-jbang-mcp) over any catalog | The project directory is a tool argument. A server with a selection (the TUI) fills it in through `ToolContext.setDefaultDirectory`; `camel mcp` requires it. `ToolDescriptor` gained a `core` flag (the subset for local models) and `inputSchema()`, `ToolContext` gained the Camel version, default directory, an extra property-line check and the auto-select-single-process switch. ### camel-jbang-mcp Thin `@Tool` wrappers per shared tool (`AuthoringTools`), the existing `RuntimeTools` delegation pattern, so `McpSecurityInterceptor` and `McpAccessFilter` keep working (the write/run/control tools carry `readOnlyHint=false` and are hidden by the `read-only` access level). `camel_catalog_doc` replaces the AsciiDoc-only tool of the same name (now `name`/`kind` plus `includeDoc=true`); `camel_error_diagnose` delegates to the shared `ErrorDiagnoser` with the same JSON fields as before; `DiagnoseData` moved to core, the CDI bean the resources inject extends it. Nobody is asked before a write: that is the MCP client's job, and the docs say so. ### camel-jbang-plugin-tui The TUI no longer defines the eight authoring tools itself: `tui_catalog_doc`, `tui_validate_source`, `tui_write_file`, `tui_get_files`, `tui_control`, `tui_get_log`, `tui_get_errors` and `tui_eval_expression` are the shared definitions now, exposed as `camel_*` (the `tui_` prefix is for what only makes sense in front of the screen). The TUI keeps its extras on top: the file tools work on the selected integration's source directory unless a `directory` is given and a write goes through the confirm dialog / live replay, `camel_control` also knows stop-all/close, `camel_get_log` also reads an infra log, and the `camelVersion` argument is stripped from the schemas (the selection has the version). `CORE_TOOLS` / `READ_ONLY_TOOLS` are derived from the descriptors' flags. The editor's YAML/properties validation (`SourceEditAssist`) delegates to the shared `SourceValidator`, keeping its Spring Boot metadata check as the extra property-line validator. Prompt budget (`AiPanelPromptBudgetTest`): core 3900 → 4300, full 7900 → 8500, system prompt 530 → 545, because the shared schemas carry the `directory`/`name` arguments and `camel_error_diagnose` joined the core set. ### Not in this PR - The TUI's runtime `tui_get_*` tools (state, tables, history, spans, topology) keep their names; the issue scopes the authoring set. - `camel_eip_sample` waits for CAMEL-24693. - The stepwise editing benchmark against `camel mcp --http` is the acceptance test to run next. ### Upgrade notes `docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc` has the renamed TUI tools, the changed `camel_catalog_doc`, and the new `camel-yaml-dsl-validator` dependency of camel-jbang-core. --- _Claude Code on behalf of davsclaus_ -- 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]
