@bevel-software/platform-mcp-core 0.25.2 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/call-guards.d.ts +47 -0
  2. package/dist/call-guards.d.ts.map +1 -0
  3. package/dist/call-guards.js +215 -0
  4. package/dist/call-guards.js.map +1 -0
  5. package/dist/dispatch.d.ts +5 -1
  6. package/dist/dispatch.d.ts.map +1 -1
  7. package/dist/dispatch.js +19 -2
  8. package/dist/dispatch.js.map +1 -1
  9. package/dist/get-has-no-body.d.ts +49 -0
  10. package/dist/get-has-no-body.d.ts.map +1 -0
  11. package/dist/get-has-no-body.js +104 -0
  12. package/dist/get-has-no-body.js.map +1 -0
  13. package/dist/index.d.ts +7 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +7 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp-app.d.ts +118 -0
  18. package/dist/mcp-app.d.ts.map +1 -0
  19. package/dist/mcp-app.js +126 -0
  20. package/dist/mcp-app.js.map +1 -0
  21. package/dist/meta-tools.d.ts +1 -1
  22. package/dist/meta-tools.d.ts.map +1 -1
  23. package/dist/meta-tools.js +28 -6
  24. package/dist/meta-tools.js.map +1 -1
  25. package/dist/proxied-tool.d.ts +33 -3
  26. package/dist/proxied-tool.d.ts.map +1 -1
  27. package/dist/proxied-tool.js +234 -21
  28. package/dist/proxied-tool.js.map +1 -1
  29. package/dist/results.d.ts +20 -1
  30. package/dist/results.d.ts.map +1 -1
  31. package/dist/results.js +117 -3
  32. package/dist/results.js.map +1 -1
  33. package/dist/schema-validity.d.ts +50 -0
  34. package/dist/schema-validity.d.ts.map +1 -0
  35. package/dist/schema-validity.js +254 -0
  36. package/dist/schema-validity.js.map +1 -0
  37. package/dist/tool-interface.d.ts +137 -0
  38. package/dist/tool-interface.d.ts.map +1 -0
  39. package/dist/tool-interface.js +640 -0
  40. package/dist/tool-interface.js.map +1 -0
  41. package/dist/utcp-namespace.d.ts +14 -0
  42. package/dist/utcp-namespace.d.ts.map +1 -1
  43. package/dist/utcp-namespace.js +7 -2
  44. package/dist/utcp-namespace.js.map +1 -1
  45. package/package.json +2 -1
  46. package/src/call-guards.ts +237 -0
  47. package/src/dispatch.ts +18 -1
  48. package/src/get-has-no-body.ts +110 -0
  49. package/src/index.ts +45 -0
  50. package/src/mcp-app.ts +194 -0
  51. package/src/meta-tools.ts +31 -6
  52. package/src/proxied-tool.ts +237 -19
  53. package/src/results.ts +129 -3
  54. package/src/schema-validity.ts +264 -0
  55. package/src/tool-interface.ts +673 -0
  56. package/src/utcp-namespace.ts +7 -2
@@ -0,0 +1,118 @@
1
+ /**
2
+ * The MCP Apps extension (`io.modelcontextprotocol/ui`, specification
3
+ * 2026-01-26), as much of it as a SERVER has to speak.
4
+ *
5
+ * The pattern is two primitives tied together by one URI: a tool whose
6
+ * `_meta.ui.resourceUri` names a `ui://` resource, and that resource — an HTML
7
+ * page served under {@link MCP_APP_MIME_TYPE} — which the host renders in an
8
+ * iframe and then pushes the tool's result into. A host without the extension
9
+ * sees an ordinary tool with an ordinary text result and ignores the metadata,
10
+ * which is why the tool's answer must stand on its own.
11
+ *
12
+ * Deliberately no dependency: the extension's SDK would be a new package on
13
+ * both the server and the view, and the wire shape it would hide is the three
14
+ * literals below (see the Specification's Decision 10). Hexis tracks the
15
+ * specification by hand instead.
16
+ *
17
+ * Lives in `mcp-core` because BOTH surfaces serve the same view: the hosted
18
+ * proxy from the deployment it runs in, and `hexis-mcp` by fetching it from
19
+ * the deployment it bridges. One definition, so the two cannot drift.
20
+ */
21
+ /** The `_meta` key the extension's metadata rides under, on a tool and on a resource alike. */
22
+ export declare const MCP_APP_UI_META_KEY = "ui";
23
+ /**
24
+ * The media type of an MCP App view. A host that supports the extension
25
+ * recognises an app by this and nothing else; a non-conforming explicit type
26
+ * is rejected rather than coerced, so it is spelled once, here.
27
+ */
28
+ export declare const MCP_APP_MIME_TYPE = "text/html;profile=mcp-app";
29
+ /** The `ui://` scheme every app resource's URI uses. */
30
+ export declare const MCP_APP_URI_SCHEME = "ui://";
31
+ /** A tool's UI metadata: which view renders its result. */
32
+ export interface McpAppToolUi {
33
+ /** The `ui://` URI of the view resource. */
34
+ resourceUri: string;
35
+ }
36
+ /** A view resource's UI metadata: what the host's sandbox may do with it. */
37
+ export interface McpAppResourceUi {
38
+ /**
39
+ * What the sandbox may load from outside itself. `frameDomains` are the
40
+ * origins the view may put in an iframe — for Hexis, exactly the
41
+ * deployment's own public origin, because the view's whole job is to frame
42
+ * this deployment's `/embed` page.
43
+ */
44
+ csp?: {
45
+ frameDomains?: string[];
46
+ connectDomains?: string[];
47
+ resourceDomains?: string[];
48
+ };
49
+ /**
50
+ * The stable sandbox domain the host gives the view. Stable matters: the
51
+ * host derives the iframe's opaque origin from it, so a value that changed
52
+ * per render would throw away the sandbox's storage on every call.
53
+ */
54
+ domain?: string;
55
+ /** Whether the host should draw a border around the view. */
56
+ prefersBorder?: boolean;
57
+ }
58
+ /** One MCP App view, as `resources/list` and `resources/read` answer for it. */
59
+ export interface McpAppResource {
60
+ /** `ui://…` — the URI a tool's `resourceUri` points at. */
61
+ uri: string;
62
+ name: string;
63
+ title?: string;
64
+ description?: string;
65
+ /** Always {@link MCP_APP_MIME_TYPE}. */
66
+ mimeType: string;
67
+ /** The view's HTML. */
68
+ text: string;
69
+ ui: McpAppResourceUi;
70
+ }
71
+ /**
72
+ * Everything a surface needs to serve a deployment's MCP Apps: which tools
73
+ * carry UI metadata, and the views they name.
74
+ *
75
+ * `hexis-mcp` fetches exactly this shape over HTTP from the deployment, so
76
+ * the local server advertises the same apps as the hosted endpoint without
77
+ * knowing anything about what they render.
78
+ */
79
+ export interface McpAppManifest {
80
+ /** Tool name → its UI metadata. */
81
+ tools: Record<string, McpAppToolUi>;
82
+ resources: McpAppResource[];
83
+ }
84
+ /** The `_meta` object a tool carrying a view advertises. */
85
+ export declare function toolUiMeta(ui: McpAppToolUi): Record<string, unknown>;
86
+ /** The `_meta` object a view resource advertises, on both list and read. */
87
+ export declare function resourceUiMeta(ui: McpAppResourceUi): Record<string, unknown>;
88
+ /** A resource's listing entry (no content), as `resources/list` returns it. */
89
+ export declare function toListedResource(resource: McpAppResource): {
90
+ uri: string;
91
+ name: string;
92
+ title?: string;
93
+ description?: string;
94
+ mimeType: string;
95
+ _meta: Record<string, unknown>;
96
+ };
97
+ /**
98
+ * A resource's content, as `resources/read` returns it. The metadata rides
99
+ * the CONTENTS entry as well as the listing: a host that preloads a view
100
+ * straight from a tool's `resourceUri` never saw the listing, and the CSP is
101
+ * what decides whether its sandbox may frame anything at all.
102
+ */
103
+ export declare function toReadResourceResult(resource: McpAppResource): {
104
+ contents: Array<{
105
+ uri: string;
106
+ mimeType: string;
107
+ text: string;
108
+ _meta: Record<string, unknown>;
109
+ }>;
110
+ };
111
+ /**
112
+ * Parse a manifest off the wire (the local server's fetch from a deployment),
113
+ * keeping only what is well-formed. A deployment too old to serve one, or one
114
+ * whose answer is a proxy's HTML, must leave the local server with NO apps
115
+ * rather than with a half-built one — the tools it bridges still work.
116
+ */
117
+ export declare function parseMcpAppManifest(body: unknown): McpAppManifest;
118
+ //# sourceMappingURL=mcp-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-app.d.ts","sourceRoot":"","sources":["../src/mcp-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAE7D,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,GAAG,CAAC,EAAE;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ChC,CASA;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG;IAC9D,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAClG,CAWA;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CA8CjE"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * The MCP Apps extension (`io.modelcontextprotocol/ui`, specification
3
+ * 2026-01-26), as much of it as a SERVER has to speak.
4
+ *
5
+ * The pattern is two primitives tied together by one URI: a tool whose
6
+ * `_meta.ui.resourceUri` names a `ui://` resource, and that resource — an HTML
7
+ * page served under {@link MCP_APP_MIME_TYPE} — which the host renders in an
8
+ * iframe and then pushes the tool's result into. A host without the extension
9
+ * sees an ordinary tool with an ordinary text result and ignores the metadata,
10
+ * which is why the tool's answer must stand on its own.
11
+ *
12
+ * Deliberately no dependency: the extension's SDK would be a new package on
13
+ * both the server and the view, and the wire shape it would hide is the three
14
+ * literals below (see the Specification's Decision 10). Hexis tracks the
15
+ * specification by hand instead.
16
+ *
17
+ * Lives in `mcp-core` because BOTH surfaces serve the same view: the hosted
18
+ * proxy from the deployment it runs in, and `hexis-mcp` by fetching it from
19
+ * the deployment it bridges. One definition, so the two cannot drift.
20
+ */
21
+ /** The `_meta` key the extension's metadata rides under, on a tool and on a resource alike. */
22
+ export const MCP_APP_UI_META_KEY = 'ui';
23
+ /**
24
+ * The media type of an MCP App view. A host that supports the extension
25
+ * recognises an app by this and nothing else; a non-conforming explicit type
26
+ * is rejected rather than coerced, so it is spelled once, here.
27
+ */
28
+ export const MCP_APP_MIME_TYPE = 'text/html;profile=mcp-app';
29
+ /** The `ui://` scheme every app resource's URI uses. */
30
+ export const MCP_APP_URI_SCHEME = 'ui://';
31
+ /** The `_meta` object a tool carrying a view advertises. */
32
+ export function toolUiMeta(ui) {
33
+ return { [MCP_APP_UI_META_KEY]: { resourceUri: ui.resourceUri } };
34
+ }
35
+ /** The `_meta` object a view resource advertises, on both list and read. */
36
+ export function resourceUiMeta(ui) {
37
+ return { [MCP_APP_UI_META_KEY]: { ...ui } };
38
+ }
39
+ /** A resource's listing entry (no content), as `resources/list` returns it. */
40
+ export function toListedResource(resource) {
41
+ return {
42
+ uri: resource.uri,
43
+ name: resource.name,
44
+ ...(resource.title !== undefined ? { title: resource.title } : {}),
45
+ ...(resource.description !== undefined ? { description: resource.description } : {}),
46
+ mimeType: resource.mimeType,
47
+ _meta: resourceUiMeta(resource.ui),
48
+ };
49
+ }
50
+ /**
51
+ * A resource's content, as `resources/read` returns it. The metadata rides
52
+ * the CONTENTS entry as well as the listing: a host that preloads a view
53
+ * straight from a tool's `resourceUri` never saw the listing, and the CSP is
54
+ * what decides whether its sandbox may frame anything at all.
55
+ */
56
+ export function toReadResourceResult(resource) {
57
+ return {
58
+ contents: [
59
+ {
60
+ uri: resource.uri,
61
+ mimeType: resource.mimeType,
62
+ text: resource.text,
63
+ _meta: resourceUiMeta(resource.ui),
64
+ },
65
+ ],
66
+ };
67
+ }
68
+ /**
69
+ * Parse a manifest off the wire (the local server's fetch from a deployment),
70
+ * keeping only what is well-formed. A deployment too old to serve one, or one
71
+ * whose answer is a proxy's HTML, must leave the local server with NO apps
72
+ * rather than with a half-built one — the tools it bridges still work.
73
+ */
74
+ export function parseMcpAppManifest(body) {
75
+ const empty = { tools: {}, resources: [] };
76
+ if (!body || typeof body !== 'object' || Array.isArray(body))
77
+ return empty;
78
+ const raw = body;
79
+ const tools = {};
80
+ if (raw.tools && typeof raw.tools === 'object' && !Array.isArray(raw.tools)) {
81
+ for (const [name, value] of Object.entries(raw.tools)) {
82
+ const uri = value?.resourceUri;
83
+ if (typeof uri === 'string' && uri.startsWith(MCP_APP_URI_SCHEME)) {
84
+ tools[name] = { resourceUri: uri };
85
+ }
86
+ }
87
+ }
88
+ const resources = [];
89
+ if (Array.isArray(raw.resources)) {
90
+ for (const entry of raw.resources) {
91
+ if (!entry || typeof entry !== 'object')
92
+ continue;
93
+ const r = entry;
94
+ // A view with no URI or no HTML is nothing a host can render, and a
95
+ // media type that is not the app one would be rejected downstream
96
+ // anyway — drop it here, where the reason is still legible.
97
+ if (typeof r.uri !== 'string' || !r.uri.startsWith(MCP_APP_URI_SCHEME))
98
+ continue;
99
+ if (typeof r.text !== 'string' || r.text === '')
100
+ continue;
101
+ if (r.mimeType !== MCP_APP_MIME_TYPE)
102
+ continue;
103
+ resources.push({
104
+ uri: r.uri,
105
+ name: typeof r.name === 'string' && r.name ? r.name : r.uri,
106
+ ...(typeof r.title === 'string' ? { title: r.title } : {}),
107
+ ...(typeof r.description === 'string' ? { description: r.description } : {}),
108
+ mimeType: MCP_APP_MIME_TYPE,
109
+ text: r.text,
110
+ ui: r.ui && typeof r.ui === 'object' && !Array.isArray(r.ui)
111
+ ? r.ui
112
+ : {},
113
+ });
114
+ }
115
+ }
116
+ // Only tools whose view actually arrived: a `resourceUri` pointing at a
117
+ // resource this surface cannot serve would have a host preload a 404 and
118
+ // show the reader an empty frame where the text used to be.
119
+ const served = new Set(resources.map((r) => r.uri));
120
+ for (const name of Object.keys(tools)) {
121
+ if (!served.has(tools[name].resourceUri))
122
+ delete tools[name];
123
+ }
124
+ return { tools, resources };
125
+ }
126
+ //# sourceMappingURL=mcp-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-app.js","sourceRoot":"","sources":["../src/mcp-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AAE7D,wDAAw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MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAC9B,CAAC"}
@@ -15,7 +15,7 @@ import { type ChainExampleTool } from './chain-example.js';
15
15
  *
16
16
  * What a chain DOES, though — to a failure, to a large result, to an image —
17
17
  * is true of every call, and those rules are stated once, in the handshake
18
- * instructions and in the platform-managed agent guide, rather than on each
18
+ * instructions and in the platform's agent guide, rather than on each
19
19
  * tool they cover. So on a surface that has those rules the chain description
20
20
  * ends with the same pointer sentence every file tool ends with, composed
21
21
  * where the tool is served and the guide's configured name is known
@@ -1 +1 @@
1
- {"version":3,"file":"meta-tools.d.ts","sourceRoot":"","sources":["../src/meta-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAmC,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAU5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,wUAA8W,CAAC;AAE/Y,qGAAqG;AACrG,eAAO,MAAM,wBAAwB,oYAC+U,CAAC;AAyCrX,wEAAwE;AACxE,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MA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,wUAA8W,CAAC;AAE/Y,qGAAqG;AACrG,eAAO,MAAM,wBAAwB,oYAC+U,CAAC;AA0CrX,wEAAwE;AACxE,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,SAAS,gBAAgB,EAAO,EACvC,OAAO,GAAE,wBAA6B,GACrC,OAAO,EAAE,CA0CX;AAeD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAA+D,CAAC;AAChH,qFAAqF;AACrF,eAAO,MAAM,0BAA0B,SAAU,CAAC;AAgBlD;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9D;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,CAAC,EAAE,SAAS,GAChB,OAAO,CAAC,cAAc,CAAC,CA4HzB"}
@@ -2,6 +2,7 @@ import { utcpNameToTsInterfaceName, findToolsByNames, sanitizeIdentifier } from
2
2
  import { chainExample } from './chain-example.js';
3
3
  import { toCallToolResult, toolError, describeToolFailure, withTransportDetail, omitImagePayloads } from './results.js';
4
4
  import { retiredToolInFailure } from './retired-tools.js';
5
+ import { withCallExample } from './tool-interface.js';
5
6
  import { CHAIN_TIMEOUT_DEFAULT_MS, CHAIN_TIMEOUT_MAX_MS, CHAIN_TIMEOUT_MIN_MS, runToolChain, } from './chain-runtime.js';
6
7
  /**
7
8
  * Code-mode meta-tools exposed ALONGSIDE the direct tools. They let an external
@@ -17,7 +18,7 @@ import { CHAIN_TIMEOUT_DEFAULT_MS, CHAIN_TIMEOUT_MAX_MS, CHAIN_TIMEOUT_MIN_MS, r
17
18
  *
18
19
  * What a chain DOES, though — to a failure, to a large result, to an image —
19
20
  * is true of every call, and those rules are stated once, in the handshake
20
- * instructions and in the platform-managed agent guide, rather than on each
21
+ * instructions and in the platform's agent guide, rather than on each
21
22
  * tool they cover. So on a surface that has those rules the chain description
22
23
  * ends with the same pointer sentence every file tool ends with, composed
23
24
  * where the tool is served and the guide's configured name is known
@@ -103,7 +104,8 @@ function callToolChainDescription(example, sharedRulesPointer) {
103
104
  // A name the catalog really has, or no name: see `ChainExample.name`.
104
105
  const forInstance = name ? ` (e.g. \`${name}\`)` : '';
105
106
  const howToWriteOne = [
106
- `Execute a short JavaScript program with direct access to every registered UTCP tool as a synchronous function. Call tools as \`${ns}.<tool>({ body: { ...args } })\` with NO \`await\` (results are already resolved), and \`return\` the final value.${worked} Every argument a tool declares REQUIRED must be present — \`tools_info\` gives the exact shapes, and for the knowledge-base tools that includes \`branch\`. The runtime is plain JavaScript (no type annotations / no TypeScript-only syntax), plus \`atob\`, \`btoa\`, \`TextEncoder\` and \`TextDecoder\` for base64 and UTF-8 bytes, as in a browser. There is no \`Buffer\`, no \`fetch\` and no \`require\`.`,
107
+ `Execute a short JavaScript program with direct access to every registered UTCP tool as a synchronous function, with NO \`await\` (results are already resolved), and \`return\` the final value.${worked} The runtime is plain JavaScript (no type annotations / no TypeScript-only syntax), plus \`atob\`, \`btoa\`, \`TextEncoder\` and \`TextDecoder\` for base64 and UTF-8 bytes, as in a browser. There is no \`Buffer\`, no \`fetch\` and no \`require\`.`,
108
+ `There is NO single calling shape: call each tool as the \`Call:\` line atop its description shows; every tool in \`${ns}\` has one. Mismatched arguments are refused before anything runs.`,
107
109
  `Discover first: \`list_tools\` lists every tool in callable form${forInstance}; \`tools_info\` returns their exact argument + return shapes — do not guess. Batch multiple tool calls into one chain to avoid a round-trip per call. The chain runs with your own connection key, so it can only reach the tools you can already call directly.`,
108
110
  ];
109
111
  if (sharedRulesPointer !== undefined)
@@ -126,7 +128,7 @@ function callToolChainDescription(example, sharedRulesPointer) {
126
128
  export function codeModeMetaTools(namespace, tools = [], options = {}) {
127
129
  const example = chainExample(namespace, tools);
128
130
  const { name } = example;
129
- return [
131
+ return withCallExamples([
130
132
  {
131
133
  name: 'list_tools',
132
134
  description: `List every UTCP tool currently registered, in TypeScript-accessible form${name ? ` (e.g. \`${name}\`)` : ''} for use inside \`call_tool_chain\`.`,
@@ -163,7 +165,19 @@ export function codeModeMetaTools(namespace, tools = [], options = {}) {
163
165
  additionalProperties: false,
164
166
  },
165
167
  },
166
- ];
168
+ ]);
169
+ }
170
+ /**
171
+ * Each of the three with its call example ahead of its description, from the
172
+ * same generator every other tool's comes from — so "every description opens
173
+ * with its call" holds with no exception an agent has to learn.
174
+ *
175
+ * These three are called DIRECTLY over MCP rather than from inside a chain, so
176
+ * the example shows that shape: the tool's name and its required arguments,
177
+ * with no namespace in front.
178
+ */
179
+ function withCallExamples(tools) {
180
+ return tools.map((t) => ({ ...t, description: withCallExample(t.description, t.name, t.inputSchema) }));
167
181
  }
168
182
  /**
169
183
  * The meta-tool NAMES, which no namespace can change. Kept separate from
@@ -215,8 +229,16 @@ export async function dispatchMetaTool(client, name, args, spill) {
215
229
  const resolved = await findToolsByNames(client, names);
216
230
  for (const n of names) {
217
231
  const found = resolved.get(n);
218
- if (found)
219
- interfaces.push(client.toolToTypeScriptInterface(found.tool));
232
+ // The call example travels with the interface too: `tools_info` is
233
+ // where an agent writing a chain reads the shape, and reading it there
234
+ // without the example is how a flat tool's arguments end up in a
235
+ // `body`. Added to a COPY — the repository's tool is not ours to edit.
236
+ if (found) {
237
+ interfaces.push(client.toolToTypeScriptInterface({
238
+ ...found.tool,
239
+ description: withCallExample(found.tool.description, found.utcpName, found.tool.inputs),
240
+ }));
241
+ }
220
242
  else
221
243
  notFound.push(n);
222
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AAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,0EAA0E;QAC1E,wEAAwE;QACxE,0EAA0E;QAC1E,mEAAmE;QACnE,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1F,IAAI,OAAO;YAAE,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,SAAS,CAAC,QAAQ,IAAI,kBAAkB,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Tool as McpTool } from '@modelcontextprotocol/sdk/types.js';
2
2
  import type { JsonSchema, Tool as UtcpTool } from '@utcp/sdk';
3
+ import { type McpAppToolUi } from './mcp-app.js';
3
4
  /** A tool discovered from a UTCP manual, flattened into what an MCP surface advertises. */
4
5
  export interface ProxiedTool {
5
6
  utcpName: string;
@@ -9,6 +10,16 @@ export interface ProxiedTool {
9
10
  /** The UTCP manual this tool came from (the `<manual>` in `<manual>.<tool>`),
10
11
  * used to look up the manual's declared per-user credentials before dispatch. */
11
12
  manualName: string;
13
+ /**
14
+ * The MCP Apps view this tool's result renders in, when it carries one.
15
+ *
16
+ * Not part of the UTCP manual a tool is discovered from — UTCP has no place
17
+ * for it — so a surface attaches it by tool NAME from the deployment's app
18
+ * manifest (`McpAppManifest.tools`) after flattening. `toListedTool` turns
19
+ * it into the `_meta` an MCP client reads; a client without the extension
20
+ * ignores the field, so carrying it costs nothing.
21
+ */
22
+ ui?: McpAppToolUi;
12
23
  }
13
24
  /** A discovered tool as an MCP listing entry, or null if its name can't be listed. */
14
25
  export declare function toListedTool(tool: ProxiedTool): McpTool | null;
@@ -20,9 +31,28 @@ export declare function toListedTool(tool: ProxiedTool): McpTool | null;
20
31
  * - drop non-standard `format` values (OpenAPI's `int32`/`byte`/… — only the
21
32
  * JSON-Schema-standard formats above are accepted; `format` is advisory, so
22
33
  * dropping it doesn't change tool behavior).
23
- * Depth-bounded so a recursive schema degrades to a permissive `{}` node instead
24
- * of hanging or emitting the unsupported recursion; non-local/external refs
25
- * degrade the same way. Exported for direct testing.
34
+ * Everything else is passed through UNCHANGED, and both recursion guards are
35
+ * built so that hitting one cannot change a schema either:
36
+ *
37
+ * - a `$ref` that resolves back onto a schema we are already inlining is
38
+ * recursive, and inlining has no finite answer for it. It degrades to a
39
+ * permissive `{}` — which is legal, because a `$ref` only ever stands where
40
+ * a SCHEMA is expected and `{}` there means "any value". Non-local and
41
+ * unresolvable refs degrade the same way, and so does one past
42
+ * {@link MAX_INLINED_NODES}.
43
+ * - the depth cap keeps the rest of the subtree's shape, replacing only the
44
+ * objects in it with `{}` — see {@link stripPastDepth}. It cannot reach
45
+ * inside instance data, because the walk never descends into a
46
+ * {@link DATA_VALUED_KEYWORDS} value in the first place.
47
+ *
48
+ * That second rule is the fix for three tools AI clients silently dropped. The
49
+ * cap used to return `{}` at WHATEVER position it stopped at, and most
50
+ * positions in a schema are not schema positions: a tool nested deeper than
51
+ * the cap reached clients with `anyOf: {}`, `required: [{}]` or `type: {}` in
52
+ * it. None of those is valid JSON Schema, so the client refused the tool — and
53
+ * said so about a server that had sent a perfectly good schema.
54
+ *
55
+ * Exported for direct testing.
26
56
  */
27
57
  export declare function sanitizeInputSchema(schema: unknown): unknown;
28
58
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"proxied-tool.d.ts","sourceRoot":"","sources":["../src/proxied-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE9D,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAA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