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;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It mentions 'SELECT only' which implies read-only behavior, but doesn't address permissions needed, rate limits, result format, pagination, error handling, or query execution constraints. The description doesn't contradict annotations (none exist), but provides inadequate transparency for a database query tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise single sentence with zero wasted words. Front-loaded with the core purpose, and the parenthetical '(SELECT only)' efficiently conveys a critical constraint. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a database query tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns (result format, structure, or limitations), nor does it address safety considerations despite the 'SELECT only' hint. Given the complexity of SQL execution and lack of structured metadata, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional parameter semantics beyond what's in the schema. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Execute a custom SQL query') and resource ('on the database'), with explicit scope limitation ('SELECT only'). It distinguishes this tool from siblings by focusing on raw SQL execution rather than predefined analytical functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through 'SELECT only' restriction, suggesting this is for read-only data retrieval. However, it provides no explicit guidance on when to use this vs. the many specialized sibling tools (e.g., get_historical_prices, get_esg_scores), nor any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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