You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7aa26b7
Browse filesBrowse the repository at this point in the historyBrowse files
Exposing a function over MCP requires `jsonSerializable: true`.
209
+
The `agent` field implicitly enables strict JSON serialization because MCP consumes JSON-shaped data. Set `jsonSerializable: true` directly when an RPC-only function also benefits from that contract.
description: 'RPC function "{name}" has agent set but jsonSerializable is not true; MCP requires JSON-serializable data.'
3
+
description: 'RPC function "{name}" has agent set but jsonSerializable is false; MCP requires JSON-serializable data.'
4
4
---
5
5
6
6
## Message
7
7
8
-
> RPC function "`{name}`" has `agent` set but `jsonSerializable` is not `true`; MCP requires JSON-serializable data.
8
+
> RPC function "`{name}`" has `agent` set but `jsonSerializable` is `false`; MCP requires JSON-serializable data.
9
9
10
10
## Cause
11
11
12
-
The `agent` field exposes an RPC function as an MCP tool, and MCP only consumes JSON-shaped data. A function with `agent` set is rejected unless it also declares `jsonSerializable: true`.
12
+
The `agent` field exposes an RPC function as an MCP tool and implicitly enables strict JSON serialization. An explicit `jsonSerializable: false` conflicts with MCP's JSON-shaped data.
Set`jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only.
27
+
Remove`jsonSerializable: false` to use the implicit JSON contract, or remove `agent` to keep the function RPC-only.
27
28
28
29
```ts
29
30
defineRpcFunction({
@@ -36,4 +37,4 @@ defineRpcFunction({
36
37
37
38
## Source
38
39
39
-
-[`packages/devframe/src/rpc/collector.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/rpc/collector.ts): `RpcFunctionsCollectorBase.register()` throws `DF0019` when a definition has`agent`set but is not declared `jsonSerializable: true`.
40
+
-[`packages/devframe/src/rpc/collector.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/rpc/collector.ts): `RpcFunctionsCollectorBase.register()` throws `DF0019` when a definition combines`agent`with `jsonSerializable: false`.
0 commit comments