Skip to main content
Glama
descope-sample-apps

descope-mcp-server

Official

search-users

Find users in your Descope project by searching text across user fields or filtering by email, phone, status, role, tenant, SSO app, or login ID.

Instructions

Search for users in Descope project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoText to search for in user fields
emailsNoFilter by specific email addresses
phonesNoFilter by specific phone numbers
statusesNoFilter by user statuses ('enabled', 'disabled', or 'invited')
rolesNoFilter users by role names
tenantIdsNoFilter users by specific tenant IDs
ssoAppIdsNoFilter users by SSO application IDs
loginIdsNoFilter by specific login IDs
withTestUserNoInclude test users in results
testUsersOnlyNoReturn only test users
pageNoPage number for pagination
limitNoNumber of users per page (max 100)

Implementation Reference

  • The handler function that executes the 'search-users' tool. It calls the Descope management.user.search API with the provided filter parameters and returns a formatted text response with the user data or an error message.
        async ({ text, emails, phones, statuses, roles, tenantIds, ssoAppIds, loginIds, withTestUser, testUsersOnly, page, limit }) => {
            try {
                const users = await descope.management.user.search({
                    text,
                    emails,
                    phones,
                    statuses,
                    roles,
                    tenantIds,
                    ssoAppIds,
                    loginIds,
                    withTestUser,
                    testUsersOnly,
                    page,
                    limit,
                });
    
                return {
                    content: [
                        {
                            type: "text",
                            text: `Found users:\n\n${JSON.stringify(users.data, null, 2)}`,
                        },
                    ],
                };
            } catch (error) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Error searching users: ${error}`,
                        },
                    ],
                };
            }
        },
    );
  • Zod input schema defining all parameters for filtering and paginating user searches in the Descope project.
    {
        // Search parameters
        text: z.string().optional()
            .describe("Text to search for in user fields"),
        emails: z.array(z.string()).optional()
            .describe("Filter by specific email addresses"),
        phones: z.array(z.string()).optional()
            .describe("Filter by specific phone numbers"),
        statuses: z.array(z.enum(['enabled', 'disabled', 'invited'])).optional()
            .describe("Filter by user statuses ('enabled', 'disabled', or 'invited')"),
        roles: z.array(z.string()).optional()
            .describe("Filter users by role names"),
        tenantIds: z.array(z.string()).optional()
            .describe("Filter users by specific tenant IDs"),
        ssoAppIds: z.array(z.string()).optional()
            .describe("Filter users by SSO application IDs"),
        loginIds: z.array(z.string()).optional()
            .describe("Filter by specific login IDs"),
        withTestUser: z.boolean().optional()
            .describe("Include test users in results"),
        testUsersOnly: z.boolean().optional()
            .describe("Return only test users"),
        page: z.number().min(0).optional()
            .describe("Page number for pagination"),
        limit: z.number().min(1).max(100).default(10)
            .describe("Number of users per page (max 100)"),
    },
  • src/descope.ts:101-103 (registration)
    Registers the 'search-users' tool on the MCP server with its name, description, schema, and handler.
    server.tool(
        "search-users",
        "Search for users in Descope project",
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation, potential rate limits, authentication requirements, or what the return format looks like (e.g., paginated results). This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity (12 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain behavioral aspects like pagination handling, result format, or error conditions, leaving the agent with insufficient context to use the tool effectively beyond basic parameter input.

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, so the schema fully documents all 12 parameters. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline of 3 where schema does the heavy lifting without extra value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Search for') and resource ('users in Descope project'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'search-audits' beyond the resource name, missing explicit distinction in scope or function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'create-user' or 'invite-user', nor does it mention prerequisites or contextual constraints. The description only states what it does, not when it's appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/descope-sample-apps/descope-mcp-server-stdio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server