Skip to main content
Glama

Run a GraphQL query

graphql_query
Read-only

Run a read-only GraphQL query against the Shopify Admin API to fetch data other tools miss, such as variants, SKUs, inventory per location, customers, or metafields.

Instructions

Runs one read query against the store's Admin GraphQL API, for anything the other tools do not cover: variants and SKUs, inventory per location, customers, collections, discounts, fulfilments, metafields.

Only queries are accepted: a mutation or subscription is refused before it is sent. What the query may read is limited to the access scopes the store granted the app (see get_shop).

Ask for no more than you need: lists take first: N (keep it at 100 or below) and Shopify bills a query by the items it requests. Page with pageInfo { hasNextPage endCursor } and after.

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": {
      "query": "<query>"
    },
    "name": "graphql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesA GraphQL query document with exactly one query operation.
variablesNoValues for the query's variables.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and openWorldHint, but the description adds substantial context beyond them: mutations/subscriptions are rejected pre-flight, results are constrained by the store's granted access scopes, and queries are billed by item count. The pagination pattern and page-size ceiling further disclose behavior an agent cannot infer from annotations.

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?

Front-loads the purpose in the first clause, then layers constraints, scope caveat, cost model, and pagination in a logical order. Each sentence carries distinct information with no repetition of the schema or annotations.

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?

For an open-ended GraphQL escape hatch with no output schema, the description covers the essentials: accepted operation type, permission bounds, cost, and result pagination. It does not describe the response envelope or error shape, which is a minor gap given the tool's breadth.

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 baseline is 3; the description earns an extra point by adding meaning to what belongs inside the `query` string — the first: N ceiling and the pageInfo { hasNextPage endCursor } / after pagination shape. It says less about `variables`, but the schema already documents it adequately.

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 ("Runs one read query against the store's Admin GraphQL API") and explicitly carves out its niche as the catch-all for "anything the other tools do not cover," listing concrete resource examples (variants, SKUs, inventory, metafields). An agent can distinguish this from list_orders or list_products without opening any schema.

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 explicit when-to-use (resources the dedicated tools don't cover), when-not (mutations and subscriptions are refused before sending), and points to get_shop for the scope prerequisite that determines whether a query will succeed. It also supplies operational guidance — keep first at 100 or below, paginate with pageInfo/after — which is exactly the kind of routing an agent needs.

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