GitHub user aicam added a comment to the discussion: Architecture discussion: 
multiple agent tool calls vs. a dedicated TexeraMCP server for exposing Texera 
functionality to the agent

My take: **inline tools should be the default for Texera-native actions; MCP is 
for third-party systems.**

MCP earns its overhead when you integrate a system you *don't own* — e.g. a 
stock-market feed in a finance app — where you consume someone else's server 
instead of writing tools yourself. But our agent tools are thin adapters over 
our *own* REST endpoints. Putting an MCP boundary between our agent and our own 
API just adds a hop and a service to maintain, with no ownership line to 
justify it.

**Proposal: make the endpoints themselves agent-ready, so adding a tool is zero 
extra effort.** Instead of hand-writing a tool wrapper in `agent-service` per 
endpoint, annotate the endpoint with the metadata an agent needs (description + 
which params matter), and auto-register it as a tool.

```scala
// 1) Endpoint declares its agent metadata next to the JAX-RS annotations.
@AgentTool(
  name        = "list_datasets",
  description = "List datasets the current user can access. Use before wiring 
data into a workflow."
)
@GET @Path("/list")
@Produces(Array(MediaType.APPLICATION_JSON))
def listDatasets(
  @AgentParam("Filter by visibility: all | public | private", required = false)
  @QueryParam("visibility") visibility: String = "all",
  @Auth user: SessionUser          // injected context — NOT exposed to the 
agent
): List[DashboardDataset]
```

A registry scans these at startup and serves a manifest at `GET 
/api/agent-tools`; `agent-service` turns each entry into a tool with **one 
generic adapter**:

```ts
// 2) One adapter registers every annotated endpoint — no per-tool file.
for (const t of await fetchAgentToolManifest()) {
  tools[t.name] = tool({
    description: t.description,
    inputSchema: jsonSchema(t.inputSchema),
    execute: (args, { abortSignal }) =>
      callBackend(t.http, args, { token: userToken, abortSignal }),
  });
}
```

**Net effect:** a new agent capability = an endpoint + two annotations. No new 
TS file, no hand-synced schema, descriptions live with the code, and 
auth/context params are filtered out automatically.

*(Sketch to frame the idea, not a finished design — open to iterating on the 
annotation surface and how read-only vs. side-effecting tools get gated.)*


GitHub link: 
https://github.com/apache/texera/discussions/5610#discussioncomment-17256747

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to