Skip to main content
Glama
victor-velazquez-ai

Enterprise MCP Template

execute_query

Execute queries against enterprise APIs like Salesforce or NetSuite using languages such as SOQL or SuiteQL. Retrieve structured data with pagination and authentication support.

Instructions

Execute a query against the upstream API.

TEMPLATE: Replace with your API's query language documentation. Examples: SuiteQL (NetSuite), SOQL (Salesforce), GraphQL, OData, etc.

Args: query: Query string in the upstream API's query language. account_id: Account ID (required if not configured on server). base_url: Optional full API URL (overrides account_id). limit: Maximum number of results. offset: Starting offset for pagination.

Returns: Structured response with query results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
account_idNo
base_urlNo
limitNo
offsetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the `execute_query` tool, which is an asynchronous function decorated with `@mcp.tool()`. It uses an API client to run the query and returns the serialized response.
    async def execute_query(
        query: str,
        account_id: Optional[str] = None,
        base_url: Optional[str] = None,
        limit: Optional[int] = None,
        offset: Optional[int] = None,
    ) -> Dict[str, Any]:
        """
        Execute a query against the upstream API.
    
        TEMPLATE: Replace with your API's query language documentation.
        Examples: SuiteQL (NetSuite), SOQL (Salesforce), GraphQL, OData, etc.
    
        Args:
            query: Query string in the upstream API's query language.
            account_id: Account ID (required if not configured on server).
            base_url: Optional full API URL (overrides account_id).
            limit: Maximum number of results.
            offset: Starting offset for pagination.
    
        Returns:
            Structured response with query results.
        """
        token = _get_oauth_token()
    
        async with _get_client(base_url, account_id) as client:
            response = await client.execute_query(
                access_token=token,
                query=query,
                limit=limit,
                offset=offset,
            )
            return _serialize_response(response)
  • Registration of the `execute_query` tool using the `@mcp.tool()` decorator in `server.py`.
    @mcp.tool()
Behavior2/5

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

No annotations provided, leaving full burden to description. States it returns 'Structured response with query results' but fails to disclose if this is read-only (implied by name but not explicit), rate limits, authentication requirements, or error handling behavior. Template nature suggests incomplete behavioral documentation.

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

Conciseness3/5

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

Well-structured with clear Args/Returns sections, but contains inappropriate template placeholder text ('TEMPLATE: Replace with...') that wastes space and reduces clarity. Otherwise efficiently organized.

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

Completeness3/5

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

Describes the 5 parameters and mentions return structure, adequate for a query tool. However, lacks safety disclosures (despite being likely read-only) and edge case handling given zero annotations and incomplete template status.

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

Parameters4/5

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

With 0% schema description coverage, the Args section effectively compensates by documenting all 5 parameters: query language syntax, account_id conditional requirements, base_url override behavior, and pagination controls (limit/offset). Adds meaning beyond the raw schema types.

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

Purpose3/5

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

States the tool executes queries against an upstream API and lists example query languages (SuiteQL, SOQL, GraphQL), but contains placeholder template text ('TEMPLATE: Replace with...') indicating incomplete customization. Distinguishes from CRUD siblings (create_record, delete_record) by nature of being a query operation.

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?

No explicit guidance on when to use this tool versus alternatives like get_record (which likely retrieves single records by ID). The Args section explains parameter mechanics but not selection criteria or prerequisites for using this tool.

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/victor-velazquez-ai/enterprise-mcp-template'

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