Skip to content

Commit 532a02e

Browse files
committed
docs(mcp,runtime): say the stdio door judges readonly on the declaration too
The HTTP twin's writeNeverSetsField JSDoc and the unreleased describe_object readonly changeset still said the stdio door and the objects resource judge the masked field. They now say what holds: every transport judges readonly on the declared field. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvhQvy8SbR3j9f7kcb
1 parent 59ccee5 commit 532a02e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎.changeset/32530-describe-object-readonly-computed.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ fix(mcp,runtime): `describe_object` serves `readonly: true` where a write never
88
Clause-②: yes (widening)
99
Metadata-protocol: none
1010

11-
`describe_object` and the `objectstack://objects/{name}` resource served each field's `readonly` from the declared flag alone, so an agent was told it could write fields whose sent value the engine drops or replaces. Both transports now also answer `readonly: true` for a runtime-owned type (`autonumber`, including a hand-written field literal with no flag), for a `formula` field, and for a stored field that declares an `expression`. On the HTTP transport, `readonly` is judged on the field as declared, so a stored expression the caller is not shown (it names a field they cannot read) still answers `true`, and the expression itself stays hidden. Over stdio and on the resource, which hold only the object as the caller is served it, the expression case answers `true` where the caller is shown the expression. An ordinary field still answers `readonly: false`, and a declared `readonly` still answers `true`.
11+
`describe_object` and the `objectstack://objects/{name}` resource served each field's `readonly` from the declared flag alone, so an agent was told it could write fields whose sent value the engine drops or replaces. Both transports now also answer `readonly: true` for a runtime-owned type (`autonumber`, including a hand-written field literal with no flag), for a `formula` field, and for a stored field that declares an `expression`. On every transport, the resource included, `readonly` is judged on the field as declared, so a stored expression the caller is not shown (it names a field they cannot read) still answers `true`, and the expression itself stays hidden. An ordinary field still answers `readonly: false`, and a declared `readonly` still answers `true`.
1212

1313
`readonly` is the schema's answer, not the caller's field edit permission: a field the caller may read but not edit still answers `readonly: false`, and a write naming it is refused as before. The tool description now says so, and it also says that a `defaultValue` may be a token the server resolves (`NOW()`, `current_user`) or an expression object, so an agent omits the field instead of copying the value.

‎packages/runtime/src/domains/mcp.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,10 @@ function describeServedObject(def: any, declared: any): Record<string, unknown>
666666
* caller cannot read, while the engine still computes the column from it.
667667
*
668668
* The twin is `writeNeverSetsField` in `packages/mcp/src/mcp-server-runtime.ts`,
669-
* which has only the masked object to ask: there the expression arm holds where
670-
* the caller is served the expression.
669+
* which the stdio bridge and the `objectstack://objects/{name}` resource ask of
670+
* the declared field too: the stdio caller view hands the declaration it masked
671+
* beside the served object (`readObjectWithDeclaration`), so every transport
672+
* answers this verdict alike.
671673
*/
672674
function writeNeverSetsField(f: any): boolean {
673675
if (!f || typeof f !== 'object') return false;

0 commit comments

Comments
 (0)