execute_custom_query
Run custom SQL SELECT queries to analyze data relationships in the Spanish stock exchange database.
Instructions
Execute a custom SQL query on the database (SELECT only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL SELECT query to execute | |
| params | No | Optional parameters for the query |
Implementation Reference
- src/index.ts:545-565 (registration)Registration of the 'execute_custom_query' tool in the server's tools array, specifying name, description, and input schema.name: 'execute_custom_query', description: 'Execute a custom SQL query on the database (SELECT only)', inputSchema: { type: 'object', properties: { sql: { type: 'string', description: 'SQL SELECT query to execute', }, params: { type: 'array', items: { type: 'string', }, description: 'Optional parameters for the query', default: [], }, }, required: ['sql'], }, },
- src/index.ts:547-564 (schema)Input schema for the execute_custom_query tool, defining sql (required string) and optional params array.inputSchema: { type: 'object', properties: { sql: { type: 'string', description: 'SQL SELECT query to execute', }, params: { type: 'array', items: { type: 'string', }, description: 'Optional parameters for the query', default: [], }, }, required: ['sql'], },
- src/database.ts:345-347 (handler)The core handler function for executing custom queries, currently implemented as a stub that throws an error indicating lack of support.async executeCustomQuery(sql: string, params: any[] = []): Promise<any[]> { throw new Error('Custom SQL queries are not supported via the Cloudflare Worker API. Please use the specific endpoints available.'); }
- src/index.ts:690-692 (helper)Helper switch case in the main tool request handler that routes 'execute_custom_query' calls to the Database instance's executeCustomQuery method.case 'execute_custom_query': result = await this.db.executeCustomQuery((args as any)?.sql, (args as any)?.params || []); break;