Skip to main content
Glama

API Keg — Spec Slice (OpenAPI & GraphQL Subgraph Extractor)

Slice GraphQL SDL Schema to Minimal Subgraph

slice_graphql_schema
Read-onlyIdempotent

Parses GraphQL Schema Definition Language (Query, Mutation, Subscription, type, input, interface, union, enum, scalar), scores root fields against query or explicit rootFields, and emits a valid mini-SDL containing only selected root fields and the transitive closure of referenced types. Pricing: $0.001 USD per GraphQL SDL subgraph slice (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.

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": {
      "sdl": "<sdl>"
    },
    "name": "slice_graphql_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
sdlYesFull GraphQL Schema Definition Language (SDL) string.
queryNoNatural-language task intent scored against root Query, Mutation, and Subscription fields.
rootFieldsNoExplicit root field names to extract (e.g. 'createCreditNote' or 'Mutation.refundInvoice').
maxRootFieldsNoMaximum number of matched root fields to retain in the mini-SDL.
operationTypesNoOptional filter restricting root operation containers.
compactDescriptionsNoStrip triple-quoted and single-line descriptions from the emitted mini-SDL.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuinely new context absent from annotations: per-slice pricing at $0.001 USD via x402 micropayment and a free REST dry_run validation path, both of which materially affect an agent's decision to call it. The dry_run note is only weakly qualified ("on REST") for an MCP tool that exposes no dry_run parameter, which slightly blurs the guidance.

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?

Three front-loaded sentences that lead with the parse/score/emit pipeline and the SDL type coverage. The pricing and dry-run sentence earns its place for cost-aware agents, though the REST-specific dry_run detail is mildly noise for an MCP caller that cannot pass it.

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?

With no output schema, the description does the necessary work by describing the returned artifact (mini-SDL with transitive closure) and the six-parameter surface is fully covered by the schema. Minor gap: no statement of what happens on an invalid SDL string or an unmatched query, which matters for a tool whose required input is arbitrary user-supplied SDL.

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, but the description adds the interaction semantics the schema does not spell out: `query` is a natural-language intent scored against root fields while `rootFields` is an explicit alternative, i.e. either selection path feeds the same closure expansion. It does not clarify maxRootFields truncation behavior or compactDescriptions side effects beyond what the schema says.

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 chain (parses, scores, emits) on a specific resource (GraphQL SDL) and names the exact output form: a valid mini-SDL with only selected root fields plus the transitive closure of referenced types. This is clearly distinguishable from the sibling slice_openapi_spec, which by name operates on OpenAPI rather than GraphQL SDL.

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

Usage Guidelines3/5

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

The description implies the use case (reduce a full SDL to a minimal subgraph for a task intent) and shows the query-or-rootFields selection mode, but it never states when to prefer this over slice_openapi_spec, nor does it set exclusions such as schema size or unsupported SDL features. Usage is inferable rather than prescribed.

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