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

Function rowToTool

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

Source from the content-addressed store, hash-verified

1198// schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay
1199// absent for those callers — `tools.schema` is the schema-bearing surface.
1200const rowToTool = (
1201 row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>,
1202 annotations?: ToolAnnotations,
1203): Tool => {
1204 const owner = row.owner as Owner;
1205 const integration = IntegrationSlug.make(row.integration);
1206 const connection = ConnectionName.make(row.connection);
1207 const name = ToolName.make(row.name);
1208 return {
1209 address: toolAddress(owner, integration, connection, name),
1210 owner,
1211 integration,
1212 connection,
1213 name,
1214 pluginId: row.plugin_id,
1215 description: row.description,
1216 inputSchema: decodeJsonColumn(row.input_schema),
1217 outputSchema: decodeJsonColumn(row.output_schema),
1218 annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined),
1219 };
1220};
1221
1222// ---------------------------------------------------------------------------
1223// 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