( row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, annotations?: ToolAnnotations, )
| 1207 | // schema columns); `Tool.inputSchema`/`outputSchema` are optional and stay |
| 1208 | // absent for those callers — `tools.schema` is the schema-bearing surface. |
| 1209 | const rowToTool = ( |
| 1210 | row: ToolInvocationRow & Partial<Pick<ToolRow, "input_schema" | "output_schema">>, |
| 1211 | annotations?: ToolAnnotations, |
| 1212 | ): Tool => { |
| 1213 | const owner = row.owner as Owner; |
| 1214 | const integration = IntegrationSlug.make(row.integration); |
| 1215 | const connection = ConnectionName.make(row.connection); |
| 1216 | const name = ToolName.make(row.name); |
| 1217 | return { |
| 1218 | address: toolAddress(owner, integration, connection, name), |
| 1219 | owner, |
| 1220 | integration, |
| 1221 | connection, |
| 1222 | name, |
| 1223 | pluginId: row.plugin_id, |
| 1224 | description: row.description, |
| 1225 | inputSchema: decodeJsonColumn(row.input_schema), |
| 1226 | outputSchema: decodeJsonColumn(row.output_schema), |
| 1227 | annotations: annotations ?? (decodeJsonColumn(row.annotations) as ToolAnnotations | undefined), |
| 1228 | }; |
| 1229 | }; |
| 1230 | |
| 1231 | // Projects a tool's annotations onto the schema view. Plugins persist extra |
| 1232 | // keys alongside the declared contract (the mcp plugin stores its upstream tool |
no test coverage detected