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

Function rowToTool

packages/core/sdk/src/executor.ts:638–658  ·  view source on GitHub ↗
(
  row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
  annotations?: ToolAnnotations,
)

Source from the content-addressed store, hash-verified

636// schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay
637// absent for those callers — `tools.schema` is the schema-bearing surface.
638const rowToTool = (
639 row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
640 annotations?: ToolAnnotations,
641): Tool => {
642 const owner = row.owner as Owner;
643 const integration = IntegrationSlug.make(row.integration);
644 const connection = ConnectionName.make(row.connection);
645 const name = ToolName.make(row.name);
646 return {
647 address: toolAddress(owner, integration, connection, name),
648 owner,
649 integration,
650 connection,
651 name,
652 pluginId: row.plugin_id,
653 description: row.description,
654 inputSchema: decodeJsonColumn(row.input_schema),
655 outputSchema: decodeJsonColumn(row.output_schema),
656 annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined),
657 };
658};
659
660// ---------------------------------------------------------------------------
661// Condition builders

Callers 5

produceConnectionToolsFunction · 0.85
toolsListFunction · 0.85
toolSchemaFunction · 0.85
toolSuggestionsFunction · 0.85
executeFunction · 0.85

Calls 2

decodeJsonColumnFunction · 0.85
toolAddressFunction · 0.70

Tested by

no test coverage detected