Skip to main content
Glama
soil-dev

capsulemcp

get_current_user

Retrieve the user identity associated with the current API token to verify ownership and audit connector activity.

Instructions

Show the user owning the API token this connector is using. Useful for audit ('under whose Capsule identity is the connector running?') and for confirming a token rotation moved ownership to the expected account. Wraps Capsule's GET /users/current — note the endpoint is /users/current, not /users/me.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for get_current_user. It calls capsuleGet("/users/current") to fetch the user owning the PAT, returning the data (with { user: ... }) from Capsule's API.
    export async function getCurrentUser(_input: z.infer<typeof getCurrentUserSchema>) {
      const { data } = await capsuleGet<{ user: unknown }>("/users/current");
      return data;
    }
  • Input schema for get_current_user — an empty object (no parameters needed).
    export const getCurrentUserSchema = z.object({});
  • Registration of the get_current_user tool on the MCP server. Wraps the handler with registerTool helper, providing name, description, schema, and handler function.
    registerTool(
      server,
      "get_current_user",
      "Show the user owning the API token this connector is using. Useful for audit ('under whose Capsule identity is the connector running?') and for confirming a token rotation moved ownership to the expected account. Wraps Capsule's GET /users/current — note the endpoint is /users/current, not /users/me.",
      getCurrentUserSchema,
      getCurrentUser,
    );
  • The generic registerTool helper that wraps the handler's return value into MCP's standard text content response format.
    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);
      });
    }
  • capsuleGet — the HTTP client helper used by getCurrentUser to make GET requests to the Capsule API with authentication, retry, and pagination support.
    export async function capsuleGet<T>(path: string, params?: QueryParams): Promise<PagedResult<T>> {
      const token = getToken();
      const url = buildUrl(path, params);
      const { res, cleanup } = await doFetch(url, { headers: baseHeaders(token) });
      try {
        const data = await handleResponse<T>(res);
        const nextPage = parseNextPage(res.headers.get("Link"));
        return { data, nextPage };
      } finally {
        cleanup();
      }
    }
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses the endpoint (/users/current) and notes the difference from /users/me, indicating a read operation. It does not discuss error handling or side effects, but for a simple read tool this is adequate.

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 two sentences plus a brief parenthetical, all front-loaded with purpose and usage. Every sentence adds value with no redundancy.

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

Completeness5/5

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

Given no parameters, no output schema, and a simple function, the description fully covers purpose, usage, and endpoint detail. It is complete for an agent to select and invoke correctly.

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

Parameters4/5

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

The tool has zero parameters, so the baseline is 4. The description adds no parameter info, but none is needed; the schema is complete with 100% coverage.

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?

The description clearly states the tool's purpose: 'Show the user owning the API token'. It uses a specific verb (show) and resource (current user), and is distinct from sibling tools which are all different operations.

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?

The description provides explicit use cases: audit and token rotation confirmation. It does not explicitly compare to alternatives, but the tool is unique among siblings, making the guidance sufficient.

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