Skip to main content
Glama

Seller Labs Amazon MCP

execute_sql

Execute SQL queries on the user's Amazon seller data to retrieve THEIR specific business metrics.

WORKFLOW BEFORE EXECUTING SQL:

  1. ALWAYS use search_context_files FIRST to check for ready-to-use query patterns The context files contain a cookbook with 31+ tested queries for common seller questions

  2. If no pattern exists, use get_table_info or DESCRIBE to verify schema

  3. Then write and execute SQL

VENUE_ID FILTERING:

  • Most tables should be filtered by venue_id

  • If the user specifies a venue, use that

  • Otherwise, call get_org_info ONCE per session to get the defaultVenueId

  • Don't call get_org_info repeatedly if you already have the venue_id

SCHEMA VERIFICATION:

  • Before querying a table for the FIRST TIME, use get_table_info or DESCRIBE to verify column names

  • NEVER guess column names - always verify them first

  • Once you've seen a table's schema in this conversation, you don't need to check again

Use this tool when users ask about their personal data:

  • "What's MY [metric]?" (e.g., "What's my ACoS?")

  • "Show me my [data]" (e.g., "Show me my inventory")

  • "How much did I [action]?" (e.g., "How much did I spend on ads?")

  • Any question requiring their actual numbers from the database

Key tables available:

  • fba_inventory: Current FBA stock levels, condition, fulfillable quantity

  • sl_daily_sku_profit: Daily profit by SKU (revenue, costs, margins, units sold)

  • campaign_performance: Campaign metrics (spend, sales, impressions, clicks)

  • product_ad_performance: Product-level ad metrics

  • order_items: Order line items with pricing and quantities

  • search_query_performance: Search Query Performance (SQP) keyword data, weekly

Use SHOW TABLES to discover all tables. Remember: search_context_files has 31+ ready-to-use query patterns - use them before writing SQL from scratch!

NOTE: For live campaign state (current bids, current status), use the ads tools (list_sp_campaigns, list_sp_keywords) instead — the Data Hub is synced periodically and may not reflect changes made in the last few hours.

IMPORTANT: Always backtick reserved keywords: condition, key, rank, order, status

SEARCH QUERY PERFORMANCE (SQP): the search_query_performance (weekly) and search_query_performance_by_month views, filtered on venue_id like the others. SQP is enabled per brand on request, so an EMPTY RESULT usually means SQP was never enabled for the account — NOT that the seller has no search data. Never report "you have no search query data" from an empty result alone: search context files for "search query performance" to diagnose it and to get the wording for directing the seller to support.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "execute_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesThe SQL query to execute (SELECT, SET, SHOW, DESCRIBE, DESC, and EXPLAIN statements only)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does substantial work: it discloses that the Data Hub is only periodically synced, that empty SQP results usually mean SQP was never enabled rather than no data, and that reserved keywords must be backticked. It does not cover result-size limits, truncation, timeouts, or error behavior for a query tool, which are the remaining behavioral gaps.

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?

Front-loaded with purpose and workflow, but the '31+ ready-to-use query patterns' point is made twice (step 1 and the closing 'Remember' line), and the get_org_info caution is restated. The table list and SQP paragraph are useful but the total length is well past what the tool strictly needs.

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?

Covers the full pre-execution workflow, table discovery via SHOW TABLES, and the most likely false conclusion (empty SQP result). For a tool with no output schema, the main omission is any statement about how results come back — row caps, truncation, or pagination.

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?

Schema coverage is 100%, so the single sql parameter is already documented as SELECT/SET/SHOW/DESCRIBE/EXPLAIN only. The description adds genuine meaning beyond that: a catalog of key tables with what each contains, the venue_id filtering convention and its default resolution path, and reserved-word quoting rules.

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?

States a specific verb and resource ('Execute SQL queries on the user's Amazon seller data') plus the scope of what it returns (the caller's own business metrics). It also distinguishes itself from the ads siblings by directing live campaign state questions to list_sp_campaigns/list_sp_keywords.

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

Usage Guidelines5/5

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

Gives an explicit ordered workflow (search_context_files first, then get_table_info/DESCRIBE, then write SQL) and concrete trigger examples ('What's my ACoS?', 'Show me my inventory'). It also names the alternative for live data and warns against repeated get_org_info calls.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources