Claus Ibsen created CAMEL-24834:
-----------------------------------
Summary: camel-jbang-mcp: load AI tool groups (SQL, tracing,
resilience) from what the selected app has, read-only SQL for local models
Key: CAMEL-24834
URL: https://issues.apache.org/jira/browse/CAMEL-24834
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
The camel-jbang-mcp server's AI tool set for local models is a fixed core set
of 19 tools. Hosted providers get the full set of 47. A local model therefore
cannot use the tools it would need for a question that depends on what the
running app has: it cannot run a SQL query against the app's datasource to
check that a message landed in a table, cannot read spans when tracing is on,
and cannot inspect a circuit breaker or aggregator.
A local model is typically pointed at one app. The server already knows which
app is selected and the dev consoles say what that app has. So the tool set
should be a function of the app, not only of the provider.
Proposal:
* Keep the core set as the base for local models.
* Add tool groups that are loaded when the selected app reports the matching
feature:
** SQL: execute_sql, get_datasources, get_sql_trace, when the datasource
console reports a datasource
** tracing: get_spans and trace_control, when tracing is enabled
** resilience: get_circuit_breakers, when a circuit breaker is in the routes;
the aggregator state likewise
* When a group joins, add one line of guidance with it: the datasource names,
and that table names come from the SQL trace, so the model does not guess a
schema.
* For local models the SQL tool is read-only (SELECT only) unless the user
enables writes, the same way the tool mode is a setting today. The model is not
the security boundary. Hosted providers in full mode keep the current behaviour.
* The prefix changes only when the selected app changes or the app gains the
feature after a reload, so the prompt cache is re-filled once per app.
Later, a meta tool that lets the model ask for a named group on demand (the
remaining tools: screen, drawing, tape, memory and threads) so a local model
can reach the full set at the cost of one re-prefill per group. Coarse groups,
since every change of the tool set re-fills the prompt prefix.
The prompt budget test guards the size of the prefix in both modes and should
cover the loaded groups too.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)