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

Function rowToTool

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

Source from the content-addressed store, hash-verified

1137// schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay
1138// absent for those callers — `tools.schema` is the schema-bearing surface.
1139const rowToTool = (
1140 row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
1141 annotations?: ToolAnnotations,
1142): Tool => {
1143 const owner = row.owner as Owner;
1144 const integration = IntegrationSlug.make(row.integration);
1145 const connection = ConnectionName.make(row.connection);
1146 const name = ToolName.make(row.name);
1147 return {
1148 address: toolAddress(owner, integration, connection, name),
1149 owner,
1150 integration,
1151 connection,
1152 name,
1153 pluginId: row.plugin_id,
1154 description: row.description,
1155 inputSchema: decodeJsonColumn(row.input_schema),
1156 outputSchema: decodeJsonColumn(row.output_schema),
1157 annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined),
1158 };
1159};
1160
1161// ---------------------------------------------------------------------------
1162// Condition builders

Callers 5

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