Skip to main content
Glama
soil-dev

capsulemcp

create_project

Create a new project linked to an existing party in Capsule CRM. Provide at least the party ID and project name; optionally set status, owner, team, stage, description, and expected close date.

Instructions

Create a new project (case) in Capsule CRM linked to a party. Requires partyId and name; description, status, owner, and starting board/stage are optional. To pin a project to a specific board+stage on creation, pass stageId (which uniquely identifies a stage within a board). Discover valid ids via list_boards + list_stages. Returns the created project including its assigned id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
partyIdYesID of the party linked to this project
descriptionNo
statusNoDefaults to OPEN when omitted.
ownerIdNoAssign to user ID. Defaults to the API-token owner when omitted, same as create_party / create_opportunity / create_task. NOTE: some Capsule tenants configure board-level **automation rules** that mutate `owner` (and `team`) on project creation — e.g. an automation that clears `owner` when a project enters a particular board. If you observe a project landing with unexpected `owner: null` after a create_project with `ownerId`, check the target board's automation configuration. Capsule's API itself does not drop `ownerId` when `stageId` is also supplied.
teamIdNoAssign to team ID (discover via list_teams). Capsule projects must always have at least one of {owner, team} set — Capsule returns 422 'owner or team is required' otherwise. Three ownership shapes are valid: owner alone, team alone, or owner+team (the user must be a member of the team — users can belong to multiple teams; 422 'owner is not a member of the team' otherwise). Tenant-specific board automations may set the team field on project creation (e.g. 'when project enters board X, set team to T'). If you observe a team set despite omitting `teamId`, check the target board's automation rules.
stageIdNoStage (board column) to place the project on. Discover IDs via list_stages — each stage belongs to one Board, so picking a stageId implicitly picks the board. If omitted, the project is created with no stage assignment (and won't appear on any board). NOTE: tenant-specific board automation rules may run on project creation and mutate `owner` / `team` fields. See `create_project.ownerId` / `create_project.teamId` for the automation caveat. Capsule's create endpoint itself preserves the `ownerId` / `teamId` you supply — any clearing you observe traces to board automations, not the API.
expectedCloseOnNoYYYY-MM-DD

Implementation Reference

  • The actual handler function that creates a project by POSTing to Capsule's /kases endpoint. It constructs a body with party, status (defaults to OPEN), owner, team, and stage.
    export async function createProject(input: z.infer<typeof createProjectSchema>) {
      const { partyId, ownerId, teamId, status, stageId, ...rest } = input;
    
      // Default applied here (not via zod's .default()) so the inferred
      // input type keeps `status` optional. Same pattern as listTasks.
      const body: Record<string, unknown> = {
        ...rest,
        status: status ?? "OPEN",
        party: { id: partyId },
      };
      if (ownerId) body["owner"] = { id: ownerId };
      if (teamId) body["team"] = { id: teamId };
      // Capsule's create-case body uses `stage: <integer>` per the docs
      // example. The GET response uses the object form `stage: {id, name}`,
      // but we follow the documented request shape on the way in.
      if (stageId) body["stage"] = stageId;
    
      return capsulePost<{ kase: unknown }>("/kases", { kase: body });
    }
  • Zod schema defining the input validation for create_project. Requires name and partyId; optional fields include description, status, ownerId, teamId, stageId, expectedCloseOn.
    export const createProjectSchema = z.object({
      name: z.string().min(1),
      partyId: z.number().int().positive().describe("ID of the party linked to this project"),
      description: z.string().optional(),
      status: z.enum(["OPEN", "CLOSED"]).optional().describe("Defaults to OPEN when omitted."),
      ownerId: z
        .number()
        .int()
        .positive()
        .optional()
        .describe(
          "Assign to user ID. Defaults to the API-token owner when omitted, same as create_party / create_opportunity / create_task. " +
            "NOTE: some Capsule tenants configure board-level **automation rules** that mutate `owner` (and `team`) on project creation — e.g. an automation that clears `owner` when a project enters a particular board. If you observe a project landing with unexpected `owner: null` after a create_project with `ownerId`, check the target board's automation configuration. Capsule's API itself does not drop `ownerId` when `stageId` is also supplied.",
        ),
      teamId: z
        .number()
        .int()
        .positive()
        .optional()
        .describe(
          "Assign to team ID (discover via list_teams). Capsule projects must always have at least one of {owner, team} set — Capsule returns 422 'owner or team is required' otherwise. " +
            "Three ownership shapes are valid: owner alone, team alone, or owner+team (the user must be a member of the team — users can belong to multiple teams; 422 'owner is not a member of the team' otherwise). " +
            "Tenant-specific board automations may set the team field on project creation (e.g. 'when project enters board X, set team to T'). If you observe a team set despite omitting `teamId`, check the target board's automation rules.",
        ),
      stageId: z
        .number()
        .int()
        .positive()
        .optional()
        .describe(
          "Stage (board column) to place the project on. Discover IDs via list_stages — each stage belongs to one Board, so picking a stageId implicitly picks the board. If omitted, the project is created with no stage assignment (and won't appear on any board). " +
            "NOTE: tenant-specific board automation rules may run on project creation and mutate `owner` / `team` fields. See `create_project.ownerId` / `create_project.teamId` for the automation caveat. Capsule's create endpoint itself preserves the `ownerId` / `teamId` you supply — any clearing you observe traces to board automations, not the API.",
        ),
      expectedCloseOn: z
        .string()
        .regex(/^\d{4}-\d{2}-\d{2}$/)
        .optional()
        .describe("YYYY-MM-DD"),
    });
  • src/server.ts:527-533 (registration)
    Registration of the create_project tool with the MCP server, wiring the schema and handler together under the name 'create_project'.
    registerTool(
      server,
      "create_project",
      "Create a new project (case) in Capsule CRM linked to a party. Requires partyId and name; description, status, owner, and starting board/stage are optional. To pin a project to a specific board+stage on creation, pass stageId (which uniquely identifies a stage within a board). Discover valid ids via list_boards + list_stages. Returns the created project including its assigned id.",
      createProjectSchema,
      createProject,
    );
  • Generic helper that wraps a handler+Zod-schema pair into an MCP tool registration, automatically stringifying the return value as JSON text.
    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?

With no annotations, the description fully discloses behavioral traits: it creates a new project, specifies required vs optional fields, and importantly warns about board automation rules that may mutate owner/team fields. Clearly explains that Capsule's API preserves supplied values but automations might override, setting accurate expectations.

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 a single well-structured paragraph that front-loads the purpose and required fields, then discusses optional parameters and behavioral caveats. It is efficient but could be slightly more concise by removing some redundant caveats; nonetheless, every sentence adds value.

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 the tool's complexity (8 parameters, automation caveats) and the absence of an output schema, the description covers the essential aspects: creation behavior, parameter constraints, and return value (including the assigned id). Minor omission: no mention of error conditions or idempotency, but not critical for a create operation.

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?

Schema description coverage is 75% (6 of 8 parameters have descriptions). The tool description adds value beyond the schema by explaining the relationship between stageId and board, and by elaborating on automation caveats for ownerId and teamId. This helps the agent understand parameter behavior beyond basic type/range.

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 'Create a new project (case) in Capsule CRM linked to a party.' The verb (create) and resource (project) are explicit, and the description differentiates from sibling tools like create_opportunity and create_party by highlighting the party link and specific parameters.

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?

Provides guidance on required fields (partyId, name), optional fields, and how to pin to a board+stage via stageId. Advises discovering valid IDs via list_boards and list_stages. Includes caveats about automation rules affecting owner/team. Does not explicitly state when not to use this tool or mention alternatives, but context is 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