execute_sql
Execute SQL queries on the sqlserver_local database to retrieve and manage data, with results returned as JSON for integration and analysis.
Instructions
Execute SQL query on the 'sqlserver_local' database. Returns query results as JSON.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query or multiple SQL statements to execute |
Implementation Reference
- src/server.ts:122-130 (handler)The handler function for the 'execute_sql' tool. Currently a stub that returns a placeholder response indicating the actual SQL execution is not yet implemented.async (args) => { // TODO: Implement actual SQL execution with database connector return createToolSuccessResponse({ message: `SQL execution on '${sourceId}' not yet implemented`, sql: args.sql, source_id: sourceId, note: "Database connector integration pending", }); }
- src/server.ts:119-121 (schema)Input schema definition for the 'execute_sql' tool using Zod, specifying a single 'sql' string parameter.{ sql: z.string().describe("SQL query or multiple SQL statements to execute"), },
- src/server.ts:116-131 (registration)Registration of the 'execute_sql' tool (with optional source suffix) in the registerTools function, called for each configured database source.server.tool( `execute_sql${toolSuffix}`, `Execute SQL query on the '${sourceId}' database. Returns query results as JSON.`, { sql: z.string().describe("SQL query or multiple SQL statements to execute"), }, async (args) => { // TODO: Implement actual SQL execution with database connector return createToolSuccessResponse({ message: `SQL execution on '${sourceId}' not yet implemented`, sql: args.sql, source_id: sourceId, note: "Database connector integration pending", }); } );
- src/types/config.ts:268-271 (schema)Type definition listing 'execute_sql' as one of the built-in database tools.export const BUILTIN_DATABASE_TOOLS = [ "execute_sql", "search_objects", // For database schema search ] as const;
- src/server.ts:79-88 (helper)Helper function used by the execute_sql handler to format successful tool responses as JSON text content.function createToolSuccessResponse(data: any) { return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; }