Skip to main content
Glama

openapi_v2_categories

Categories V2

Query Amazon category hierarchy by ID, path, parent, or keyword.

Use this to discover category structure for filtering in other endpoints. Example: pass categoryKeyword="yoga" to find matching categories, or parentCategoryPath=["Sports & Outdoors"] to list child categories.

Query modes (mutually exclusive):

  • No parameters: Returns all root categories

  • categoryId: Get specific category by ID

  • categoryPath: Get specific category by path

  • parentCategoryId: Get children of parent category by ID

  • parentCategoryPath: Get children of parent category by path

  • categoryKeyword: Search categories by keyword

Related: /products/search accepts categoryPath. /markets/search uses exactly one of category.ids, category.path, or category.name; category.includeDescendantCategoryProducts controls whether each market's metrics include descendant-category products.

Responses:

200: Successful Response (Success Response) Content-Type: application/json

Example Response:

{
  "success": true,
  "meta": {
    "requestId": "Requestid",
    "timestamp": "Timestamp"
  }
}

Output Schema:

{
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "description": "Whether the request was successful",
      "default": true
    },
    "data": {
      "title": "Data",
      "description": "Response data payload"
    },
    "error": {
      "description": "Error details if request failed"
    },
    "meta": {
      "description": "Metadata for API responses.\n\nCredit fields follow the ADR-0003 parallel-fields strategy (Option 3):\n- `credits_remaining` / `credits_consumed` (int): legacy fields, rounded\n  to whole credits, kept for zero-breaking-change to existing SDK clients.\n- `credits_remaining_exact` / `credits_consumed_exact` (float): new\n  precision-aware fields for clients that opt in to decimal credits.\n\nSee ADR-0003 decision 5 and the \u00a78 deprecation timeline.\n\nTODO(2026-11, ADR-0003 \u00a78 +6mo): mark `credits_remaining` /\n`credits_consumed` as `deprecated=True` in their Field() definitions\nand announce in customer changelog.\nTODO(2027-05, ADR-0003 \u00a78 +12mo): remove the legacy int fields via a\nmajor-version bump of the OpenAPI surface.",
      "properties": {
        "requestId": {
          "type": "string",
          "title": "Requestid",
          "description": "Unique request identifier"
        },
        "timestamp": {
          "type": "string",
          "title": "Timestamp",
          "description": "Response timestamp in ISO 8601 format"
        },
        "total": {
          "title": "Total",
          "description": "Total number of records"
        },
        "page": {
          "title": "Page",
          "description": "Current page number"
        },
        "pageSize": {
          "title": "Pagesize",
          "description": "Number of records per page"
        },
        "totalPages": {
          "title": "Totalpages",
          "description": "Total number of pages"
        },
        "creditsRemaining": {
          "title": "Creditsremaining",
          "description": "Remaining API credits (rounded to whole credits; see creditsRemainingExact for precise value)"
        },
        "creditsConsumed": {
          "title": "Creditsconsumed",
          "description": "Credits consumed by this request (rounded; see creditsConsumedExact for precise value)"
        },
        "creditsRemainingExact": {
          "title": "Creditsremainingexact",
          "description": "Remaining API credits, precise to 1 decimal place"
        },
        "creditsConsumedExact": {
          "title": "Creditsconsumedexact",
          "description": "Credits consumed by this request, precise to 1 decimal place"
        },
        "tokensUsage": {
          "description": "Provider token-usage block \u2014 populated on terminal video polls only, null on every non-video endpoint. See TokensUsage for its fields."
        }
      },
      "type": "object",
      "required": [
        "requestId",
        "timestamp"
      ],
      "title": "ResponseMeta"
    }
  },
  "type": "object",
  "required": [
    "meta"
  ],
  "title": "OpenApiResponse[list[Category]]",
  "examples": []
}

422: Validation Error Content-Type: application/json

Example Response:

{
  "detail": [
    {
      "loc": [],
      "msg": "Message",
      "type": "Error Type",
      "ctx": {}
    }
  ]
}

Output Schema:

{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {},
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryIdNoCategory identifier
marketplaceNoAmazon marketplace code. Only 'US' is currently supported.US
categoryPathNoCategory hierarchy from root to current level (e.g., ['Electronics', 'Computers', 'Laptops'])
categoryKeywordNoFilter by category name keyword (matches any level in category hierarchy, e.g., 'Electronics' or 'Laptops')
parentCategoryIdNoParent category ID
parentCategoryPathNoParent category path

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / marketplace / const
      Added value: +"US"
    • changedInput schema / properties / marketplace / description
      Previous value: -"Amazon marketplace code"New value: +"Amazon marketplace code. Only 'US' is currently supported."
    • removedInput schema / properties / marketplace / enum
      Removed value: -[
      -  "US",
      -  "UK"
      -]
    • removedInput schema / properties / marketplace / x-unsupported-values
      Removed value: -[
      -  "UK"
      -]
  2. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations are absent, so the description carries the full burden. It implies read-only behavior via 'Query' and states that no parameters returns all root categories, but it does not explicitly declare read-only status, authentication requirements, rate limits, or side effects. It does disclose mutual exclusivity of parameters and provides response structure, but without annotations, a more explicit behavioral profile would be stronger.

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 prose portion is concise and well-structured: purpose, example, query modes, and related endpoints are clearly organized and front-loaded. However, the description includes a large response schema block (due to no separate output schema) that makes the overall text lengthy, though this is a necessary inclusion rather than redundancy. The core guidance is tight and efficient.

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

Completeness5/5

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

The description covers all 6 optional parameters, explains the behavior for each query mode, includes examples, and details how this tool connects to other endpoints. It also embeds the output schema (since no separate schema exists) and error responses. For a read-only discovery tool with no required parameters, this is comprehensive enough for an agent to select and invoke it correctly without ambiguity.

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?

The input schema already describes each parameter (100% coverage), but the description adds significant context: it explains the mutual exclusivity of query modes, what each mode does (e.g., 'No parameters: Returns all root categories'), and provides an example. This goes beyond the schema's field descriptions, enhancing the agent's understanding of parameter combinations and intended usage.

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?

The description clearly states the tool queries the Amazon category hierarchy by ID, path, parent, or keyword, with a specific verb and resource. It lists distinct query modes and gives an example, and it explicitly distinguishes itself from sibling tools by mentioning related endpoints like /products/search and /markets/search, making the purpose unambiguous.

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?

The description provides explicit usage guidance: 'Use this to discover category structure for filtering in other endpoints' and then describes how this tool relates to /products/search and /markets/search, including the exact parameters those endpoints accept. It also details mutually exclusive query modes and gives a concrete example with categoryKeyword and parentCategoryPath, leaving no ambiguity about when to use it versus alternatives.

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