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

Function rowToTool

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

Source from the content-addressed store, hash-verified

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