Skip to main content
Glama

polarity_whoami

Return the polarity user ID and cosmos account info bound to this MCP key. Use it as a connectivity test to identify the user.

Instructions

Returns the polarity user id and cosmos account info that this MCP key is bound to. Cheap connectivity test. Call this first if the user asks who you know them as.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for polarity_whoami calls client.whoami(). It's an async function that ignores input and delegates to the CosmosClient's whoami method.
    {
      name: "polarity_whoami",
      description:
        "Returns the polarity user id and cosmos account info that this MCP key is bound to. Cheap connectivity test. Call this first if the user asks who you know them as.",
      inputSchema: z.object({}).strict(),
      handler: async (_input, client) => client.whoami(),
  • The input schema for polarity_whoami is an empty strict Zod object (no arguments required).
    inputSchema: z.object({}).strict(),
  • src/server.ts:38-44 (registration)
    Tools are registered via the MCP ListToolsRequestSchema handler which maps over the TOOLS array to expose them to clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS.map((t) => ({
        name: t.name,
        description: t.description,
        inputSchema: zodToJsonSchema(t.inputSchema),
      })),
    }));
  • src/server.ts:46-88 (registration)
    When a tool call is received (CallToolRequestSchema), the server looks up the tool by name via findTool() and invokes its handler with the parsed input and the CosmosClient.
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      if (!client) {
        return {
          isError: true,
          content: [{ type: "text", text: UNCONFIGURED_MESSAGE }],
        };
      }
      const tool = findTool(req.params.name);
      if (!tool) {
        return {
          isError: true,
          content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }],
        };
      }
      const parsed = tool.inputSchema.safeParse(req.params.arguments ?? {});
      if (!parsed.success) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Invalid arguments for ${tool.name}: ${parsed.error.message}`,
            },
          ],
        };
      }
      try {
        const result = await tool.handler(parsed.data, client);
        return {
          content: [
            { type: "text", text: typeof result === "string" ? result : JSON.stringify(result, null, 2) },
          ],
        };
      } catch (e) {
        const message =
          e instanceof CosmosError
            ? `${e.status} from cosmos at ${e.path}: ${typeof e.body === "string" ? e.body : JSON.stringify(e.body)}`
            : e instanceof Error
              ? e.message
              : String(e);
        return { isError: true, content: [{ type: "text", text: message }] };
      }
    });
  • findTool() is a helper that looks up a ToolDef by name from the TOOLS array. Used by the MCP server to dispatch tool calls.
    export function findTool(name: string): ToolDef | undefined {
      return TOOLS.find((t) => t.name === name);
    }
  • The whoami() method on CosmosClient makes a GET request to /api/polarity/whoami and returns a WhoamiResponse (polarity_user_id, cosmos_user_id, scopes, created_at).
      whoami() {
        return this.request<WhoamiResponse>({
          method: "GET",
          path: "/api/polarity/whoami",
        });
      }
    }
Behavior4/5

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

No annotations provided, so the description carries the full burden. It discloses the tool is cheap and returns identity info, but doesn't mention failure modes or side effects, though for a simple read tool this is minor.

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?

Two concise sentences, front-loaded with key information. Every sentence earns its place 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?

For a parameterless tool with no output schema, the description fully covers purpose, usage, and return content. It is complete for the tool's simplicity.

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

Parameters5/5

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

No parameters in schema, but the description adds meaning by specifying the return values (user id, cosmos account info). This compensates for the empty schema and provides essential context.

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?

Clearly states it returns polarity user id and cosmos account info, and describes it as a connectivity test. Distinguishes from sibling tools by its identity/connectivity role.

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

Usage Guidelines5/5

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

Explicitly instructs to call this first when the user asks who they are known as, and implies it's a cheap test. Provides clear when-to-use guidance.

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/teampolarity/cosmos-mcp'

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