Find Category (ID by Name / Name by ID)


Looks up post categories to resolve a category ID from a name, or a name from an ID. Use this FIRST whenever the user refers to a category by name and another ability requires a category ID. Provide "search" with the full or partial category name, or provide "id".

Property Value
Ability slug mosmcp/category-find
Wire tool name mosmcp__category-find
Category Categories (mosmcp-categories)
Plan Free

 

Required access

Requirement Value
Capability edit_posts
Minimum default role Contributor
Annotations readOnly: true · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
search string (min length 1) — Full or partial category name to search for. Provide either this or "id".
id integer (min 1) — A category ID to look up. Provide either this or "search".

 

Output schema

Field Type Required
showing integer Yes
total integer Yes
matches object[] Yes
matches[].id integer Yes
matches[].name string Yes
matches[].slug string
matches[].description string
matches[].parent_id integer
matches[].parent_name string
matches[].post_count integer Yes
matches[].edit_url string

 

Example

Sample prompt
What's the ID of the 'Recipes' category?

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 59,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__category-find",
    "arguments": {
      "input": {
        "search": "Recipe"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 59,
  "result": {
    "isError": false,
    "structuredContent": {
      "showing": 1,
      "total": 1,
      "matches": [
        {
          "id": 23,
          "name": "Recipes",
          "slug": "recipes",
          "description": "",
          "parent_id": 5,
          "parent_name": "Food",
          "post_count": 12,
          "edit_url": "https://example.com/wp-admin/term.php?taxonomy=category&tag_ID=23"
        }
      ]
    }
  }
}

 

Edge cases / errors

  • Neither search nor id provided → refused with missing_input.
  • id that does not exist → an empty matches list rather than an error.
  • search includes empty categories, is ordered by name and returns at most 10 matches; total gives the full count.

 


<< Previous Next >>
Delete Category Get Category

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.