Skip to main content
Glama

openapi_v2_keyword_detail

Get keyword detail

  1. Function

Return a single-week raw statistical snapshot for one or more keywords: search demand, competition and advertising metrics from the latest available week on or before date. The observed period is reported in context.dataWindow; resolvedDate is the actual snapshot date. Both single and batch requests return data.context + data.items[]. This is snapshot data, not a scored market assessment.

  1. Use cases

Use detail to compare current raw metrics when screening candidate keywords. Use market-profile for market scores, levels and interpretations; use trend for raw weekly history.

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": {
      "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[KeywordDetailData]",
  "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
dateYesLookup date (YYYY-MM-DD). Returns the latest snapshot on or before this date; actual date is `resolvedDate`.
keywordNoSingle keyword; mutually exclusive with `keywords`. Surrounding whitespace is trimmed; letter case is accepted.
keywordsNoKeyword list, up to 20; mutually exclusive with `keyword`. Must equal `LOWER(TRIM(value))`; uppercase letters and surrounding whitespace are rejected. Duplicate keywords are rejected.
granularityNoData period granularity. Only `week` is currently supported.week
marketplaceNoAmazon marketplace code. Only 'US' is currently supported.US

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • addedInput schema / oneOf
      Added value: +[
      +  {
      +    "required": [
      +      "keyword"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "keywords"
      +    ]
      +  }
      +]
    • changedInput schema / properties / date / description
      Previous value: -"Lookup date in YYYY-MM-DD format. Returns the latest weekly snapshot on or before this date."New value: +"Lookup date (YYYY-MM-DD). Returns the latest snapshot on or before this date; actual date is `resolvedDate`."
    • addedInput schema / properties / date / format
      Added value: +"date"
    • addedInput schema / properties / date / pattern
      Added value: +"^\\d{4}-(0[1-9]|1[0-2])-([0-2]\\d|3[01])$"
    • addedInput schema / properties / granularity
      Added value: +{
      +  "const": "week",
      +  "default": "week",
      +  "description": "Data period granularity. Only `week` is currently supported.",
      +  "title": "granularity",
      +  "type": "string"
      +}
    • removedInput schema / properties / keyword / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  }
      -]
    • changedInput schema / properties / keyword / description
      Previous value: -"Keyword to look up."New value: +"Single keyword; mutually exclusive with `keywords`. Surrounding whitespace is trimmed; letter case is accepted."
    • addedInput schema / properties / keyword / minLength
      Added value: +1
    • addedInput schema / properties / keyword / pattern
      Added value: +"\\S"
    • removedInput schema / properties / keywords / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "maxItems": 20,
      -    "minItems": 1,
      -    "type": "array"
      -  }
      -]
    • changedInput schema / properties / keywords / description
      Previous value: -"Keywords to look up in batch, up to 20."New value: +"Keyword list, up to 20; mutually exclusive with `keyword`. Must equal `LOWER(TRIM(value))`; uppercase letters and surrounding whitespace are rejected. Duplicate keywords are rejected."
    • addedInput schema / properties / keywords / items
      Added value: +{
      +  "minLength": 1,
      +  "pattern": "^[^A-Z\\s](?:[^A-Z]*[^A-Z\\s])?$",
      +  "type": "string"
      +}
    • addedInput schema / properties / keywords / maxItems
      Added value: +20
    • addedInput schema / properties / keywords / minItems
      Added value: +1
    • addedInput schema / properties / keywords / uniqueItems
      Added value: +true
  2. Changed1 schema field changed
    • removedInput schema / properties / granularity
      Removed value: -{
      -  "const": "week",
      -  "default": "week",
      -  "description": "Time granularity. Keyword detail currently supports `week` only.",
      -  "title": "granularity",
      -  "type": "string"
      -}
  3. Changed3 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"
      -]
  4. Changed1 schema field changed
    • changedInput schema / properties / date / description
      Previous value: -"Lookup date in YYYY-MM-DD format. Data is stored as weekly snapshots, and the response returns the latest snapshot on or before this date."New value: +"Lookup date in YYYY-MM-DD format. Returns the latest weekly snapshot on or before this date."
  5. Changed4 schema fields changed
    • addedInput schema / properties / granularity
      Added value: +{
      +  "const": "week",
      +  "default": "week",
      +  "description": "Time granularity. Keyword detail currently supports `week` only.",
      +  "title": "granularity",
      +  "type": "string"
      +}
    • addedInput schema / properties / keyword / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / keywords
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 20,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  ],
      +  "description": "Keywords to look up in batch, up to 20.",
      +  "title": "keywords",
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "date",
      -  "keyword"
      -]New value: +[
      +  "date"
      +]
  6. Changed3 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"查询日期,格式 YYYY-MM-DD。数据按周快照存储,返回该日期当日或之前最近一期快照数据。"New value: +"Lookup date in YYYY-MM-DD format. Data is stored as weekly snapshots, and the response returns the latest snapshot on or before this date."
    • changedInput schema / properties / keyword / description
      Previous value: -"要查询的关键词"New value: +"Keyword to look up."
    • changedInput schema / properties / marketplace / description
      Previous value: -"亚马逊站点代码"New value: +"Amazon marketplace code"
  7. Added

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and meets it: it discloses snapshot semantics, date resolution behavior via resolvedDate/dataWindow, the fact that both single and batch requests return data.context + data.items[], and that results are raw rather than scored. It also provides response schemas for 200 and 422.

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 is well-structured with numbered Function and Use cases sections, and the core behavior is front-loaded. The embedded response schemas are verbose and include irrelevant ADR/credit details, which prevents a perfect score, but the overall organization is clear 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?

For a five-parameter endpoint with no annotations, the description, input schema, and embedded response schemas together cover invocation semantics, parameter constraints, response shape, and error handling. Nothing an agent needs to correctly select and call the tool is missing.

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

Parameters3/5

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

The input schema has 100% description coverage and already documents date format, mutual exclusivity, constraints, defaults, and whitespace/case rules. The prose description adds contextual value about output metrics but does not materially enhance parameter semantics beyond what the schema provides, so the baseline 3 is appropriate.

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 opens with a specific verb and resource and immediately defines the tool as a single-week raw statistical snapshot for keywords, including the exact metric categories and date behavior. It also distinguishes itself from sibling tools by noting it is snapshot data, not a scored market assessment.

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 explicitly states when to use detail ('compare current raw metrics when screening candidate keywords') and when to use alternatives ('market-profile for market scores, levels and interpretations; trend for raw weekly history'). This is direct when/when-not guidance rather than leaving the agent to infer usage.

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