MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toToolDef

Function toToolDef

packages/plugins/mcp/src/sdk/plugin.ts:539–558  ·  view source on GitHub ↗
(entry: McpToolManifestEntry)

Source from the content-addressed store, hash-verified

537 * plugin-side store. Executor's `ToolDef` has no `_meta` field of its own, so
538 * the stamp is where a host reads it back. */
539const toToolDef = (entry: McpToolManifestEntry): ToolDef => {
540 const destructive = entry.annotations?.destructiveHint === true;
541 const stamp: McpToolStamp = {
542 toolName: entry.toolName,
543 ...(entry.annotations ? { upstream: entry.annotations } : {}),
544 ...(entry._meta ? { _meta: entry._meta } : {}),
545 };
546 const annotations: StampedAnnotations = {
547 requiresApproval: destructive,
548 ...(destructive ? { approvalDescription: entry.annotations?.title ?? entry.toolName } : {}),
549 mcp: stamp,
550 };
551 return {
552 name: ToolName.make(entry.toolId),
553 description: entry.description ?? `MCP tool: ${entry.toolName}`,
554 inputSchema: entry.inputSchema,
555 outputSchema: mcpCallToolResultOutputSchema(entry.outputSchema),
556 annotations: annotations as ToolAnnotations,
557 };
558};
559
560const McpTextContent = Schema.Struct({ type: Schema.Literal("text"), text: Schema.String });
561const McpToolCallEnvelope = Schema.Struct({

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected