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

Function rowToTool

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

Source from the content-addressed store, hash-verified

873// schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay
874// absent for those callers — `tools.schema` is the schema-bearing surface.
875const rowToTool = (
876 row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
877 annotations?: ToolAnnotations,
878): Tool => {
879 const owner = row.owner as Owner;
880 const integration = IntegrationSlug.make(row.integration);
881 const connection = ConnectionName.make(row.connection);
882 const name = ToolName.make(row.name);
883 return {
884 address: toolAddress(owner, integration, connection, name),
885 owner,
886 integration,
887 connection,
888 name,
889 pluginId: row.plugin_id,
890 description: row.description,
891 inputSchema: decodeJsonColumn(row.input_schema),
892 outputSchema: decodeJsonColumn(row.output_schema),
893 annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined),
894 };
895};
896
897// ---------------------------------------------------------------------------
898// 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