Skip to main content
Glama
soil-dev

capsulemcp

update_track

Update specific fields of a track, such as marking it complete, by providing only the fields to change using partial PUT semantics.

Instructions

Update a track instance. Capsule's PUT semantics are partial — provide only the fields you want to change in fields. Common: { complete: true } to mark a track completed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trackIdYes
fieldsYesObject of fields to update on the track. Capsule's PUT semantics are partial — only the fields you provide are changed. Common: { complete: true } to mark a track completed. Capsule rejects unknown keys; consult Capsule's docs for the full updatable set.

Implementation Reference

  • The core handler function that updates a track instance by sending a PUT request to Capsule CRM's /tracks/{trackId} endpoint. It validates that at least one field is provided, then passes the fields through to the Capsule API.
    export async function updateTrack(input: z.infer<typeof updateTrackSchema>) {
      if (Object.keys(input.fields).length === 0) {
        throw new Error("update_track: provide at least one field in `fields`");
      }
      return capsulePut<{ track: unknown }>(`/tracks/${input.trackId}`, {
        track: input.fields,
      });
    }
  • Zod schema defining the input for update_track: requires a numeric trackId and a record of fields to update. The fields use partial PUT semantics (only provided fields are changed).
    export const updateTrackSchema = z.object({
      trackId: z.number().int().positive(),
      fields: z
        // zod 4: z.record requires an explicit key schema (was implicit
        // string in zod 3). Capsule field names are strings.
        .record(z.string(), z.unknown())
        .describe(
          "Object of fields to update on the track. Capsule's PUT semantics are partial — only the fields you provide are changed. Common: { complete: true } to mark a track completed. Capsule rejects unknown keys; consult Capsule's docs for the full updatable set.",
        ),
    });
  • src/server.ts:577-583 (registration)
    Registration of the 'update_track' tool with the MCP server, mapping the tool name to its schema and handler via the registerTool helper.
    registerTool(
      server,
      "update_track",
      "Update a track instance. Capsule's PUT semantics are partial — provide only the fields you want to change in `fields`. Common: { complete: true } to mark a track completed.",
      updateTrackSchema,
      updateTrack,
    );
  • src/server.ts:172-183 (registration)
    Import of updateTrackSchema and updateTrack from the tracks module into the server configuration.
    import {
      listEntityTracksSchema,
      listEntityTracks,
      showTrackSchema,
      showTrack,
      applyTrackSchema,
      applyTrack,
      updateTrackSchema,
      updateTrack,
      removeTrackSchema,
      removeTrack,
    } from "./tools/tracks.js";
  • Generic helper function used to register all tools (including update_track). It wraps the handler's return value in the standard MCP text-content response shape.
    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?

Discloses partial update behavior and unknown key rejection, but lacks details on side effects, authentication, or error handling. With no annotations, more transparency would be beneficial.

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, front-loaded with the core action, no redundant information.

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?

Lacks description of return value or success/failure indicators. With no output schema, more context would be helpful for full completeness.

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?

Adds meaning beyond schema by explaining partial update behavior and providing a common use case for the 'fields' parameter. trackId lacks description in schema and is not elaborated in description.

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 'Update a track instance' with specific example of use, distinguishing from sibling tools like apply_track and remove_track.

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

Usage Guidelines3/5

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

Provides partial update semantics but no explicit when-to-use or when-not-to-use guidance compared to alternatives.

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