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

Function rowToTool

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

Source from the content-addressed store, hash-verified

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