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

Function rowToTool

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

Source from the content-addressed store, hash-verified

613// schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay
614// absent for those callers — `tools.schema` is the schema-bearing surface.
615const rowToTool = (
616 row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
617 annotations?: ToolAnnotations,
618): Tool => {
619 const owner = row.owner as Owner;
620 const integration = IntegrationSlug.make(row.integration);
621 const connection = ConnectionName.make(row.connection);
622 const name = ToolName.make(row.name);
623 return {
624 address: toolAddress(owner, integration, connection, name),
625 owner,
626 integration,
627 connection,
628 name,
629 pluginId: row.plugin_id,
630 description: row.description,
631 inputSchema: decodeJsonColumn(row.input_schema),
632 outputSchema: decodeJsonColumn(row.output_schema),
633 annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined),
634 };
635};
636
637// ---------------------------------------------------------------------------
638// Condition builders

Callers 5

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

Calls 2

toolAddressFunction · 0.85
decodeJsonColumnFunction · 0.85

Tested by

no test coverage detected