Search Users


Searches users by a keyword matched against username, display name, and email, paginated. Read-only. For a plain filtered listing (no keyword) use mosmcp/list-users.

Property Value
Ability slug mosmcp/search-users
Wire tool name mosmcp__search-users
Category Users & Roles (mosmcp-users)
Plan Free

 

Required access

Requirement Value
Capability list_users
Minimum default role Administrator (Shop manager too when WooCommerce is active)
Annotations readOnly: true · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
query string Yes — The keyword to search for (required).
page integer (min 1) 1 Page number to return, starting at 1.
per_page integer (1–100) 20 Users per page (max 100).

 

Output schema

Field Type Required
users object[] Yes
users[].id integer
users[].username string
users[].display_name string
users[].email string
users[].roles string[]
users[].registered string
total integer Yes
page integer Yes
per_page integer Yes

 

Example

Sample prompt
Find any users whose name or email contains 'smith'.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 195,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__search-users",
    "arguments": {
      "input": {
        "query": "smith"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 195,
  "result": {
    "isError": false,
    "structuredContent": {
      "users": [
        {
          "id": 57,
          "username": "jsmith",
          "display_name": "John Smith",
          "email": "john.smith@example.com",
          "roles": [
            "author"
          ],
          "registered": "2025-06-02 14:10:55"
        }
      ],
      "total": 1,
      "page": 1,
      "per_page": 20
    }
  }
}

 

Edge cases / errors

  • Empty or whitespace-only query → mosmcp_missing_query error ("A search query is required.").
  • The keyword is matched as a wildcard (contains) against username, email, display name and nicename.
  • per_page above 100 → clamped to 100.
  • No matches → empty users array with total 0.

 


<< Previous Next >>
Reset User's Password Send Password Reset Link

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.