Skip to main content
Glama
soil-dev

capsulemcp

remove_party_address_by_id

Remove an address from a party using its row id. Atomic and idempotent—re-adds easily if needed. Returns party details.

Instructions

Remove one address entry from a party by its row id. Atomic and reversible — no confirm: true gate (re-add with add_party_address). Discover the id via get_party. Idempotent on retry: response is {removed: true, alreadyRemoved: false, partyId, addressId, party} on a fresh remove or {removed: true, alreadyRemoved: true, partyId, addressId} if the row was already gone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partyIdYes
addressIdYesCapsule's id for the address row. Read it from get_party (each entry in addresses carries an id).

Implementation Reference

  • The main handler function that removes a party address by its Capsule row ID. Uses idempotentWithResult to call capsulePut with _delete:true on the address entry.
    export async function removePartyAddressById(input: z.infer<typeof removePartyAddressByIdSchema>) {
      const { partyId, addressId } = input;
      return idempotentWithResult(
        () =>
          capsulePut<{ party: unknown }>(`/parties/${partyId}`, {
            party: { addresses: [{ id: addressId, _delete: true }] },
          }),
        (result) => ({
          removed: true,
          alreadyRemoved: false,
          partyId,
          addressId,
          ...result,
        }),
        () => ({ removed: true, alreadyRemoved: true, partyId, addressId }),
      );
    }
  • Zod schema for removePartyAddressById — accepts partyId (positive int) and addressId (positive int, Capsule's row id).
    export const removePartyAddressByIdSchema = z.object({
      partyId: z.number().int().positive(),
      addressId: z
        .number()
        .int()
        .positive()
        .describe(
          "Capsule's id for the address row. Read it from get_party (each entry in addresses carries an id).",
        ),
    });
  • src/server.ts:375-381 (registration)
    Registration of the remove_party_address_by_id tool on the MCP server via registerTool helper.
    registerTool(
      server,
      "remove_party_address_by_id",
      "Remove one address entry from a party by its row id. Atomic and reversible — no `confirm: true` gate (re-add with add_party_address). Discover the id via get_party. Idempotent on retry: response is `{removed: true, alreadyRemoved: false, partyId, addressId, party}` on a fresh remove or `{removed: true, alreadyRemoved: true, partyId, addressId}` if the row was already gone.",
      removePartyAddressByIdSchema,
      removePartyAddressById,
    );
  • The registerTool helper function that wraps handler results in MCP text-content responses and registers them on the server.
    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);
      });
    }
Behavior5/5

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

The description fully discloses behavioral traits: atomic and reversible, no confirm gate, idempotent on retry, and detailed response format. Since annotations are absent, the description carries the full burden and meets it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact with two informative sentences, but the response details could be more streamlined. It front-loads the purpose effectively and wastes little text.

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?

Given no output schema or annotations, the description covers return format, idempotency, and prerequisite data (address id via get_party). It omits error cases or party existence checks, but overall is sufficient for a simple removal tool.

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 addressId parameter is well-documented in both schema (note about Capsule's id) and description (discover via get_party). The partyId lacks schema description, but the description implies its role. With 50% schema coverage, the description adds meaningful 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?

The description clearly states the tool's function: 'Remove one address entry from a party by its row id.' It uses a specific verb and resource, and the name differentiates it from sibling tools like remove_party_email_address_by_id.

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

Usage Guidelines2/5

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

The description does not provide guidance on when to use this tool versus alternatives such as remove_party_email_address_by_id or remove_party_phone_number_by_id. It mentions discovering the id via get_party but lacks explicit context for tool selection.

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