Skip to main content
Glama
peakacom

peaka-mcp-server

Official
by peakacom

peaka_execute_sql_query

Read-only

Execute a SQL query against a Peaka project, using schema and table cache info to ensure appropriate results.

Instructions

Runs the given sql query on Peaka.

BEFORE RUNNING THIS TOOL:
  1: Use peaka_get_project_metadata to determine which tables should be used in the query and their schemas.
  2: Use peaka_list_tables to determine if the tables of interest are cached or not (this response has isCached property)
  3: If one or more tables that you need to query are cacheable but not cached:
    3a: Warn the user that the results will be limited and, if caching tools are available in this session, offer to start caching those tables before querying
    3b: If the caching is rejected by the user, warn them that the query results will be limited and use LIMIT statements on the query to make sure it doesn't run forever

If you do not already know the projectId for the current task, call peaka_list_projects first and ask the user which project to use. Remember the chosen projectId for subsequent calls in this conversation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
projectIdYesThe Peaka project ID to run against.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds meaningful behavioral context: results may be limited if tables are not cached, and queries can run indefinitely without LIMIT. This goes beyond the annotations, though it does not describe the return format or error behavior, which keeps it from a 5.

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

Conciseness4/5

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

The description is well-structured with numbered pre-requisite steps, making it easy to follow. It front-loads the core purpose before diving into steps. It is longer than necessary but every section adds actionable guidance, so it earns a 4 rather than a 3.

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

Completeness4/5

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

Given the tool's complexity and the absence of an output schema, the description covers essential context: how to determine tables, check caching, handle projectId discovery, and mitigate runaway queries. It does not mention response shape or error handling, but for a read-only SQL executor, the provided guidance is fairly complete.

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

Parameters2/5

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

Schema description coverage is only 50% – only projectId has a description, query has none. The description does not elaborate on the query parameter beyond calling it 'sql query', and only indirectly hints at its content via the LIMIT instruction. It fails to compensate for the schema gap, leaving the agent to infer query syntax and expectations.

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

Purpose4/5

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

The description states a clear verb-resource pair: 'Runs the given sql query on Peaka.' It is specific about what it does, but does not distinguish itself from the sibling tool peaka_execute_query, which likely serves a similar function. Without explicit differentiation, an agent might struggle to choose between them, so it falls short of a 5.

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

Usage Guidelines4/5

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

The description provides explicit pre-requisites: check project metadata, list tables, verify caching status, and obtain projectId if unknown. It instructs the agent to warn users about limited results and use LIMIT statements when tables are uncached. However, it does not mention when to prefer this tool over alternatives like peaka_execute_query, so it lacks the 'when-not' guidance for a 5.

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