Skip to main content
Glama

list_subcategories

Read-onlyIdempotent

Lists subcategories under one category (id, category_id, category_name, subcategory_id, subcategory_name). This is the fourth taxonomy step.

When to use: When you already have a category_id from list_categories. Examples: 'subcategories of category A.1.1', 'find the Jurisdiction subcategory'. Pass subcategory_name only to narrow by name. When not: Do not use this for law types; use list_law_types with the returned subcategory_id. For categories use list_categories. For domains or subdomains use list_domains or list_subdomains. For documents use list_documents or search. Do not call without a category_id from list_categories. Skip if you already have this subcategory list for the same category_id and subcategory_name.

Parameters: category_id (required) is the category reference from list_categories. It must be exactly three dot-separated segments ending in a number, such as A.1.1, and is uppercased before the query. subcategory_name is an optional case-insensitive substring of the subcategory name; the parameter is subcategory_name, not subcategory. An unknown category_id returns Category not found. A category_id with the wrong shape is rejected before the query. limit defaults to 20 and is capped at 100. next_id is the numeric id from pagination.next_id, not subcategory_id. Empty data means that category has no matching subcategory.

Behavior: Read-only SELECT; does not create, update, or delete records, files, or credentials. The only effect is a database read. Auth: tools/call requires OAuth 2.0 or a Bearer token (401 if missing, invalid, revoked, or no active subscription). Rate limits: none at the MCP layer; safe to retry. Not cached; each call reads the current subcategory table. total_count is the full match count, not the page size.

Returns: A page of {id, category_id, category_name, subcategory_id, subcategory_name}. Example: {"category_id":"A.1.1","category_name":"General Private International Law","subcategory_id":"A.1.1.1","subcategory_name":"Jurisdiction"}. Pass subcategory_id, not id, to list_law_types.

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": {
      "category_id": "<category_id>"
    },
    "name": "list_subcategories"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of results to return
next_idNoNext ID to paginate the results
category_idYesFilter by Category ID
subcategory_nameNoFilter by subcategory name

Output Schema

NameRequiredDescriptionDefault
dataYesSubcategories in the requested category that have data; empty if none match.
messageYesResult message
paginationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / next_id
      Added value: +{
      +  "description": "Next ID to paginate the results",
      +  "type": "number"
      +}
    • removedInput schema / properties / offset
      Removed value: -{
      -  "description": "Number of results to skip",
      -  "type": "number"
      -}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "description": "Subcategories in the requested category that have data; empty if none match.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "category_id": {
      +            "description": "Parent category reference, such as A.1.1",
      +            "type": "string"
      +          },
      +          "category_name": {
      +            "description": "Parent category display name",
      +            "type": "string"
      +          },
      +          "id": {
      +            "description": "Numeric row id. Use only as pagination.next_id, not as subcategory_id.",
      +            "type": "number"
      +          },
      +          "subcategory_id": {
      +            "description": "Subcategory reference, such as A.1.1.1. Pass this to list_law_types as subcategory_id.",
      +            "type": "string"
      +          },
      +          "subcategory_name": {
      +            "description": "Subcategory display name, or null when unset",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "category_id",
      +          "category_name",
      +          "subcategory_id",
      +          "subcategory_name"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "message": {
      +      "description": "Result message",
      +      "type": "string"
      +    },
      +    "pagination": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "limit": {
      +          "description": "Maximum number of subcategories returned",
      +          "type": "number"
      +        },
      +        "next_id": {
      +          "description": "Cursor ID for the next page, or null when there is no next page",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "total_count": {
      +          "description": "Total number of matching subcategories",
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "total_count",
      +        "limit",
      +        "next_id"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "message",
      +    "data"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, yet the description still adds material context: OAuth/Bearer auth with 401 failure modes, no MCP-layer rate limits and safe retry, no caching so results reflect the current table, and the specific error for an unknown category_id versus a malformed one. It also clarifies that total_count is the full match count rather than the page size, which is a behavioral detail annotations cannot express.

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?

Front-loaded with purpose, then cleanly partitioned into When to use / When not / Parameters / Behavior / Returns, so the density is navigable. A few sentences restate annotation-covered ground ("Read-only SELECT; does not create, update, or delete records, files, or credentials. The only effect is a database read") and the example return value duplicates the existing output schema, which keeps it short of maximally tight.

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 four-parameter paginated lookup, the definition covers prerequisites, ID format validation, pagination token semantics, error cases, auth, and the downstream handoff ("Pass subcategory_id, not id, to list_law_types"). The output schema exists, so the Returns block is supplementary rather than load-bearing, and nothing an agent needs in order to call this correctly is missing.

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

Parameters5/5

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

Schema coverage is 100% so the baseline would be 3, but the description goes well beyond it: category_id must be exactly three dot-separated segments ending in a number (e.g. A.1.1) and is uppercased before the query, subcategory_name is a case-insensitive substring and is explicitly not called "subcategory", limit defaults to 20 and caps at 100, and next_id is the numeric pagination token rather than subcategory_id. These are non-obvious constraints the schema's one-line property descriptions do not convey.

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?

Opens with a specific verb and resource ("Lists subcategories under one category") and immediately names the returned fields. It also positions the tool in the taxonomy sequence and explicitly distinguishes it from list_categories, list_law_types, list_domains/list_subdomains, and list_documents/search, so an agent can select it without inspecting siblings.

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?

Provides an explicit "When to use" with a prerequisite (you must already have a category_id from list_categories), worked examples, and a "When not" block naming the correct alternative tool for each adjacent need. It even gives a skip condition (reuse a prior result for the same category_id and subcategory_name), which is unusually thorough routing guidance.

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.