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

Function rowToTool

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

Source from the content-addressed store, hash-verified

860// schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay
861// absent for those callers — `tools.schema` is the schema-bearing surface.
862const rowToTool = (
863 row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
864 annotations?: ToolAnnotations,
865): Tool => {
866 const owner = row.owner as Owner;
867 const integration = IntegrationSlug.make(row.integration);
868 const connection = ConnectionName.make(row.connection);
869 const name = ToolName.make(row.name);
870 return {
871 address: toolAddress(owner, integration, connection, name),
872 owner,
873 integration,
874 connection,
875 name,
876 pluginId: row.plugin_id,
877 description: row.description,
878 inputSchema: decodeJsonColumn(row.input_schema),
879 outputSchema: decodeJsonColumn(row.output_schema),
880 annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined),
881 };
882};
883
884// ---------------------------------------------------------------------------
885// 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