Skip to main content
Glama

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
NameRequiredDescriptionDefault
sqlYesSQL SELECT query to execute
paramsNoOptional 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'],
      },
    },
  • 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'],
    },
  • 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.');
    }
  • 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;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anbrme/ibex35-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server