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",

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