Skip to main content
Glama
andreadecorte

GABI MCP Server

get_query_result

Execute SQL queries on a single line to retrieve data from the current database. Use this tool to run queries against a target endpoint with proper authentication.

Instructions

Executes an SQL query on a single line against the current database.

Args: query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • gabi.py:74-74 (registration)
    The @mcp.tool() decorator registers the get_query_result tool with the MCP server.
    @mcp.tool()
  • gabi.py:75-80 (handler)
    The handler function that executes the tool logic by making a POST request to the GABI /query endpoint with the provided SQL query.
    async def get_query_result(query: str) -> str:
        """Executes an SQL query on a single line against the current database.
    
        Args: query
        """
        return await make_gabi_post_request(build_gabi_url("/query"), query)
  • gabi.py:46-65 (helper)
    Helper function used by get_query_result to perform the actual HTTP POST request to the GABI API.
    async def make_gabi_post_request(url: str, query: str) -> dict[str, Any] | None:
        """Make a POST request to GABI."""
        headers = {}
        try:
            headers = build_headers()
        except KeyError:
            return "ERROR: token not defined!"
    
        data = {
            "query": query
        }
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(url, headers=headers, timeout=30.0, json=data)
                response.raise_for_status()
                return response.json()
            except Exception as e:
                return e
  • gabi.py:14-17 (helper)
    Helper to construct the GABI endpoint URL.
    def build_gabi_url(path: str) -> str:
        """Build the endpoint for GABI"""
        return os.environ.get("GABI_ENDPOINT") + path
  • gabi.py:22-28 (helper)
    Helper to build HTTP headers including authorization token.
    def build_headers() -> dict:
        """Build headers for HTTP requests"""
        return {
            "User-Agent": USER_AGENT,
            "Authorization": f"Bearer {get_access_token()}",
            "Content-Type": "application/json"
        }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool executes SQL queries, implying it's a read/write operation, but doesn't disclose behavioral traits like whether it's read-only or destructive, what permissions are required, rate limits, or what happens on errors. The description adds minimal context beyond the basic action.

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 appropriately sized with two sentences. The first sentence states the purpose clearly, and the second lists the parameter. There's no wasted text, and it's front-loaded with the main action. However, the structure could be slightly improved by integrating the parameter info more seamlessly.

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?

Given the complexity of executing SQL queries (which can be read/write operations), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavioral traits, return values, error handling, and usage context. This is inadequate for a tool that interacts with a database.

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 0%, so the description must compensate. It adds 'Args: query' and mentions 'SQL query on a single line', which provides some semantic meaning (e.g., single-line constraint) beyond the schema's basic type information. However, it doesn't fully explain the parameter's format, valid SQL syntax, or constraints, leaving significant gaps.

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 clearly states the tool's purpose: 'Executes an SQL query on a single line against the current database.' This specifies the verb ('executes'), resource ('SQL query'), and scope ('current database'). It doesn't explicitly differentiate from the sibling tool 'get_db_name', but the purpose is clear and specific.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions 'current database' but doesn't explain what that means or how it relates to the sibling tool 'get_db_name'. There are no explicit when/when-not instructions or prerequisites for usage.

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/andreadecorte/gabi-mcp'

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