Skip to main content
Glama
soil-dev

capsulemcp

list_users

List all Capsule users with id, username, role, and party reference. Use returned user ids to filter opportunities, projects, and tasks by owner.

Instructions

List all users in the Capsule account. Returns each user's id, username, optional first/last name, role, and party reference. Some users may have null first/last name fields (only username set) — fall back to username for display. Use this to discover user ids for owner-filtered queries against opportunities, projects, and tasks, or to map a user to their party record via user.party.id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
perPageNo

Implementation Reference

  • The actual handler function for the list_users tool. Calls capsuleGet to fetch /users from the Capsule CRM API with pagination (page, perPage). Returns data along with nextPage from the Link header.
    export async function listUsers(input: z.infer<typeof listUsersSchema>) {
      const { data, nextPage } = await capsuleGet<{ users: unknown[] }>("/users", {
        page: input.page ?? 1,
        perPage: input.perPage ?? 100,
      });
      return { ...data, nextPage };
    }
  • Zod schema for list_users input. Defines optional page (positive integer) and perPage (1-100 integer) parameters.
    export const listUsersSchema = z.object({
      page: z.number().int().positive().optional(),
      perPage: z.number().int().min(1).max(100).optional(),
    });
  • src/server.ts:999-1005 (registration)
    Registration of the list_users tool on the MCP server. Calls registerTool with name 'list_users', description, listUsersSchema, and listUsers handler.
    registerTool(
      server,
      "list_users",
      "List all users in the Capsule account. Returns each user's id, username, optional first/last name, role, and party reference. Some users may have null first/last name fields (only username set) — fall back to username for display. Use this to discover user ids for owner-filtered queries against opportunities, projects, and tasks, or to map a user to their party record via user.party.id.",
      listUsersSchema,
      listUsers,
    );
  • The generic registerTool helper that wraps a handler's return value in the standard MCP text-content response format and registers it on the McpServer.
    export function registerTool<Schema extends z.ZodObject<ZodRawShape>>(
      server: McpServer,
      name: string,
      description: string,
      schema: Schema,
      handler: (input: z.infer<Schema>) => Promise<unknown>,
    ): void {
      // Use the SDK config-form registerTool with the full Zod schema. The
      // deprecated shape overload rebuilds z.object(schema.shape), which drops
      // object-level refinements such as superRefine.
      const registerWithSchema = server.registerTool.bind(server) as (
        toolName: string,
        config: { description: string; inputSchema: Schema },
        callback: (input: z.infer<Schema>) => Promise<CallToolResult>,
      ) => void;
    
      registerWithSchema(name, { description, inputSchema: schema }, async (input) => {
        const result = await handler(input);
        return wrapAsText(result);
      });
    }
Behavior4/5

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

Descriptions explains null first/last name fields and fallback to username, which adds behavioral context beyond schema. However, does not mention pagination behavior or ordering, given the page/perPage parameters.

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?

Three sentences front-loaded with purpose, then specifics; no unnecessary words. Highly concise and well-structured.

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

Completeness3/5

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

Covers purpose, return fields, null handling, and usage examples. However, given zero schema coverage and no output schema, the description should explain pagination parameters and the complete return format. It lacks this completeness.

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

Parameters1/5

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

Input schema has page and perPage parameters with no descriptions. The tool description does not explain these parameters or mention pagination, failing to add meaning to the schema fields.

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?

Description clearly states it lists all users, specifying returned fields (id, username, names, role, party reference) and distinguishes from sibling tools like list_parties by focusing on 'users' and mentioning use for owner-filtered queries.

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

Usage Guidelines4/5

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

Explicitly advises using this tool to discover user IDs for owner-filtered queries and to map users to party records, providing clear context. Does not explicitly state when not to use, but the guidance is strong.

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/soil-dev/capsulemcp'

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