Title: Agent tools from RPC `args` reach MCP clients as `arg0`/`arg1` with no names or descriptions · Issue #420 · devframes/devframe · GitHub
Open Graph Title: Agent tools from RPC `args` reach MCP clients as `arg0`/`arg1` with no names or descriptions · Issue #420 · devframes/devframe
X Title: Agent tools from RPC `args` reach MCP clients as `arg0`/`arg1` with no names or descriptions · Issue #420 · devframes/devframe
Description: What happens When an RPC function with args is exposed through agent, the MCP (and WebMCP) input schema names each positional arg arg0, arg1, and so on (argsToJsonSchema in packages/devframe/src/agent/to-json-schema.ts). There is no way ...
Open Graph Description: What happens When an RPC function with args is exposed through agent, the MCP (and WebMCP) input schema names each positional arg arg0, arg1, and so on (argsToJsonSchema in packages/devframe/src/ag...
X Description: What happens When an RPC function with args is exposed through agent, the MCP (and WebMCP) input schema names each positional arg arg0, arg1, and so on (argsToJsonSchema in packages/devframe/src/ag...
Opengraph URL: https://github.com/devframes/devframe/issues/420
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Agent tools from RPC `args` reach MCP clients as `arg0`/`arg1` with no names or descriptions","articleBody":"### What happens\n\nWhen an RPC function with `args` is exposed through `agent`, the MCP (and WebMCP) input schema names each positional arg `arg0`, `arg1`, and so on (`argsToJsonSchema` in `packages/devframe/src/agent/to-json-schema.ts`). There is no way to give an arg a name or a description.\n\nWith valibot it gets worse. valibot has no native Standard JSON Schema converter, so each arg falls back to `{ type: 'object', additionalProperties: true }`. The agent sees one opaque `arg0` object and nothing about what goes inside it.\n\n### Repro\n\nThis is the example from the agent-native guide:\n\n```ts\nimport * as v from 'valibot'\nimport { defineRpcFunction } from 'devframe'\n\nexport const getSessionSummary = defineRpcFunction({\n name: 'rolldown-get-session-summary',\n type: 'query',\n args: [v.object({ sessionId: v.string() })],\n agent: {\n description: 'Summarize a Rolldown build session.',\n },\n setup: () => ({\n handler: async ({ sessionId }) => ({ sessionId }),\n }),\n})\n```\n\n`tools/list` returns this input schema:\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"arg0\": { \"type\": \"object\", \"additionalProperties\": true }\n },\n \"required\": [\"arg0\"],\n \"additionalProperties\": false\n}\n```\n\nThe agent has to guess that it should send `{ \"arg0\": { \"sessionId\": \"...\" } }`. The existing test `falls back to a permissive object for validators without a native converter (valibot)` in `packages/devframe/src/agent/__tests__/to-json-schema.test.ts` pins this output.\n\nWith zod 4 the types come through, but the property is still `arg0`, and a description only shows up if it is set on the schema itself.\n\n### Expected\n\nThe agent sees a named parameter with a type and a description, for example:\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"sessionId\": { \"type\": \"string\", \"description\": \"Session id from the session list.\" }\n },\n \"required\": [\"sessionId\"]\n}\n```\n\n### Why it matters\n\nAgents pick and fill tools from the schema alone. `arg0` with an open object tells them nothing, so they guess, call the tool wrong, or skip it. We're building [Angular DevTools](https://github.com/santoshyadavdev/angular-devtools) on devframe, and we stopped declaring agent tools as RPC `args` for this reason. We register each one with `ctx.agent.registerTool` and a hand-written `inputSchema`, so the schema and the handler types can drift.\n\n### Possible directions\n\nOpen to whichever fits devframe best:\n\n1. **Declare names on the agent options.** For example `agent.params: [{ name: 'sessionId', description: '...' }]`, one entry per positional arg. `argsToJsonSchema` uses those names, and `toolInputToRpcArgs` maps them back to positions. Function parameter names are not reliable at runtime (the handler is built in `setup` and may be minified), so they need to be declared.\n2. **Flatten a single object arg.** When an RPC has exactly one arg and its JSON Schema is an object, advertise its properties at the top level and wrap the payload back into `arg0` on invoke. This covers the common case with no new options, but it changes the wire shape, so it may need an opt in.\n3. **Allow `agent.inputSchema` on RPC functions**, like `registerTool` already allows. This is the smallest change and also gives valibot users a way out, though it keeps the drift problem.\n\nI can send a PR once a direction is agreed.\n","author":{"url":"https://github.com/erkamyaman","@type":"Person","name":"erkamyaman"},"datePublished":"2026-10-01T12:39:47Z","url":"https://github.com/devframes/devframe/issues/420"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9bbc5978-cd54-c0e7-446a-c3d1584e2062 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E194:AF687:1123F99:17828D7:6AFB67B4 |
| html-safe-nonce | aac7912bb0003e719fba4f0971c6c14a5c151a7ac4d7b80f7ed26840505ff360 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTk0OkFGNjg3OjExMjNGOTk6MTc4MjhENzo2QUZCNjdCNCIsInZpc2l0b3JfaWQiOiI2OTI1MTY1ODY3ODM1Mjg3NDc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 76d7b9de95f59cbeca2f257808f5ed9b35636ec21a76a9e8291e849efe4da517 |
| hovercard-subject-tag | issue:5662280168 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/devframes/devframe/420/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5fcd161e76f498c9e7a062b879d7506455424e244ec9e7f5271302490f02381f/devframes/devframe/issues/420 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5fcd161e76f498c9e7a062b879d7506455424e244ec9e7f5271302490f02381f/devframes/devframe/issues/420 |
| og:image:alt | What happens When an RPC function with args is exposed through agent, the MCP (and WebMCP) input schema names each positional arg arg0, arg1, and so on (argsToJsonSchema in packages/devframe/src/ag... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erkamyaman |
| hostname | github.com |
| expected-hostname | github.com |
| None | ea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94 |
| turbo-cache-control | no-preview |
| go-import | github.com/devframes/devframe git https://github.com/devframes/devframe.git |
| octolytics-dimension-user_id | 279879373 |
| octolytics-dimension-user_login | devframes |
| octolytics-dimension-repository_id | 1231722386 |
| octolytics-dimension-repository_nwo | devframes/devframe |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1231722386 |
| octolytics-dimension-repository_network_root_nwo | devframes/devframe |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ef97164c52cf59bd10558ddec9c4f482763988 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width