Skip to main content
Glama
soil-dev

capsulemcp

get_parties

Batch fetch up to 10 parties by ID in a single API call, reducing round trips when multiple party IDs are known.

Instructions

Batch-fetch up to 10 parties by ID in a single call. Use this when Claude already knows several party IDs to avoid N round trips of get_party.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesArray of party IDs (1–10). Capsule caps batch fetches at 10.
embedNoComma-separated embeds, e.g. 'tags,fields'

Implementation Reference

  • The handler function that executes the 'get_parties' tool logic. It makes a Capsule API GET request to /parties/<id1,id2,...> with an optional embed parameter, returning the batch of parties.
    export async function getParties(input: z.infer<typeof getPartiesSchema>) {
      const { data } = await capsuleGet<{ parties: unknown[] }>(`/parties/${input.ids.join(",")}`, {
        embed: input.embed,
      });
      return data;
    }
  • Zod schema defining the input for getParties: an array of 1-10 positive integers (IDs) and an optional embed string for tags/fields.
    export const getPartiesSchema = z.object({
      ids: z
        .array(z.number().int().positive())
        .min(1)
        .max(10)
        .describe("Array of party IDs (1–10). Capsule caps batch fetches at 10."),
      embed: z.string().optional().describe(EMBED_TAGS_FIELDS_DESCRIPTION),
    });
  • src/server.ts:253-259 (registration)
    Registration of the 'get_parties' tool with the MCP server, providing its name, description, schema, and handler.
    registerTool(
      server,
      "get_parties",
      "Batch-fetch up to 10 parties by ID in a single call. Use this when Claude already knows several party IDs to avoid N round trips of get_party.",
      getPartiesSchema,
      getParties,
    );
  • The registerTool helper that wraps the handler's return value in MCP text-content format and registers it via the SDK.
    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);
      });
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the batch-fetch nature and the limit of 10 IDs. However, it does not explicitly state that this is a read-only operation or mention any other behavioral traits like idempotency or error handling.

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 sentences, each earning its place: first defines the action, second provides usage guidance. No redundant words, front-loaded with the key function.

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

Completeness4/5

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

For a simple batch-fetch tool with no output schema, the description adequately covers what it does and when to use it. It mentions the batch limit and the purpose. Could be slightly more complete by noting the return format or behavior for missing IDs, but it's largely sufficient.

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?

Schema coverage is 100% with both parameters described in the schema. The description adds context about when to use the tool, reinforcing the 'ids' parameter's purpose, but does not add new semantic meaning beyond the schema. Baseline of 3 is appropriate.

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 batch-fetches up to 10 parties by ID in a single call. The verb 'batch-fetch' and resource 'parties' are specific, and it distinguishes itself from the sibling tool 'get_party' by mentioning avoiding N round trips.

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 says to use when Claude already knows several party IDs, implying this is for bulk retrieval by known IDs rather than searching or filtering. Provides clear guidance on when to use, though could be more explicit about alternatives like 'search_parties' for searches.

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