Skip to main content
Glama

add_project_user

Add a user to a Kanboard project by specifying project ID, user ID, and optional role (project-manager, project-member, or project-viewer).

Instructions

Add a user to a Kanboard project with the given role. Role defaults to 'project-member' if not specified. Use list_project_users to find user ids and list_projects to find project ids.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesNumeric project id.
user_idYesNumeric user id to add to the project.
roleNoRole to assign: 'project-manager', 'project-member' (default), or 'project-viewer'.project-member

Implementation Reference

  • Core handler method `addProjectUser` that calls Kanboard's JSON-RPC `addProjectUser` API. Takes project_id, user_id, and optional role (defaults to 'project-member'). Throws KanboardApiError if Kanboard returns false.
    /**
     * Adds a user to a project with the given role.
     * @throws {KanboardApiError} when Kanboard returns false.
     */
    public async addProjectUser(input: {
      project_id: number;
      user_id: number;
      role?: "project-manager" | "project-member" | "project-viewer" | undefined;
    }): Promise<void> {
      const params = {
        project_id: input.project_id,
        user_id: input.user_id,
        role: input.role ?? "project-member",
      };
      const raw = await this.#apiClient.call("addProjectUser", params);
      this.#logger.debug({ method: "addProjectUser" }, "addProjectUser OK");
      decodeMutation("addProjectUser", raw);
    }
  • Zod input schema `AddProjectUserInput` — validates project_id (positive int), user_id (positive int), and role (enum: project-manager/member/viewer, defaults to 'project-member').
    export const AddProjectUserInput = z
      .object({
        project_id: z.number().int().positive().describe("Numeric project id."),
        user_id: z.number().int().positive().describe("Numeric user id to add to the project."),
        role: z
          .enum(["project-manager", "project-member", "project-viewer"])
          .default("project-member")
          .describe(
            "Role to assign: 'project-manager', 'project-member' (default), or 'project-viewer'.",
          ),
      })
      .strict();
  • Tool definition `addProjectUserTool` with name 'add_project_user', description, input schema, and handler that parses input, delegates to `deps.handler.addProjectUser()`, and returns a success result with content and structuredContent.
    export const addProjectUserTool = {
      name: "add_project_user",
      description:
        "Add a user to a Kanboard project with the given role. " +
        "Role defaults to 'project-member' if not specified. " +
        "Use list_project_users to find user ids and list_projects to find project ids.",
      inputSchema: AddProjectUserInput,
      handler: async (raw: unknown, deps: ToolDeps): Promise<AddProjectUserResult> => {
        const input = AddProjectUserInput.parse(raw);
    
        await deps.handler.addProjectUser({
          project_id: input.project_id,
          user_id: input.user_id,
          role: input.role,
        });
    
        return {
          content: [
            {
              type: "text",
              text: `User ${String(input.user_id)} added to project ${String(input.project_id)} as ${input.role}.`,
            },
          ],
          structuredContent: {
            user_id: input.user_id,
            project_id: input.project_id,
            role: input.role,
          },
        };
      },
    };
  • Tool registered in `allTools` array at position 0 (alphabetically first), ensuring it gets mounted on the MCP server via `registerTools()`.
    export const allTools: readonly ToolDef[] = [
      addProjectUserTool,
      attachFileToTaskTool,
      createColumnTool,
      createCommentTool,
      createProjectTool,
      createSubtaskTool,
      createSwimlaneTool,
      createTaskTool,
      createTasksBatchTool,
      deleteColumnTool,
      deleteCommentTool,
      deleteProjectTool,
      deleteSubtaskTool,
      deleteSwimlaneTool,
      deleteTaskTool,
      deleteTaskFileTool,
      getProjectTool,
      getTaskTool,
      listCategoriesTool,
      listColumnsTool,
      listMyTasksTool,
      listOverdueTasksTool,
      listProjectsTool,
      listSubtasksTool,
      listSwimlanesTool,
      listTasksTool,
      listProjectUsersTool,
      moveColumnTool,
      moveSwimlaneTool,
      moveTaskPositionTool,
      removeProjectUserTool,
      updateColumnTool,
      updateCommentTool,
      updateProjectTool,
      updateSubtaskTool,
      updateSwimlaneTool,
      updateTaskTool,
    ] as const;
  • `registerTools` function iterates all tools (including addProjectUserTool) and registers each with the MCP server via `server.registerTool(name, config, callback)`.
    export function registerTools(server: McpServer, deps: ToolDeps): void {
      for (const tool of allTools) {
        // Cast: each tool handler returns a `{ content, structuredContent }` object
        // that satisfies `CallToolResult`. We use `unknown` in `ToolDef.handler` to
        // keep the per-tool return types encapsulated, so we cast here at the
        // registration boundary where the MCP SDK takes ownership.
        const cb = ((args: Record<string, unknown>) =>
          tool.handler(args, deps)) as unknown as ToolCallback;
    
        server.registerTool(
          tool.name,
          {
            description: tool.description,
            inputSchema: tool.inputSchema,
          },
          cb,
        );
      }
    }
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 reveals the default role behavior, which is not fully captured by the schema default. However, it lacks details on side effects, permissions, error handling, or behavior when adding duplicate users.

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?

The description is very concise, consisting of three short sentences with no unnecessary words. Every sentence adds value: purpose, default behavior, and prerequisite tool usage.

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 is a mutation and has no output schema, the description adequately covers the action and prerequisite info. However, it lacks error handling details or differentiation from remove_project_user. It is sufficient but not exhaustive.

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 description coverage is 100%, so the baseline is 3. The description adds that role defaults to 'project-member' if not specified, but this is already implied by the schema's default value and enum. It does not significantly enhance understanding beyond the schema.

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?

Description clearly states 'Add a user to a Kanboard project with the given role', specifying the verb 'add', resource 'user to project', and role handling. It effectively distinguishes from sibling tools like remove_project_user.

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 explicit guidance on using list_project_users and list_projects to find required IDs, which helps the agent gather prerequisites. However, it does not explicitly mention when to avoid this tool or 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/ErnestoCorona/kanboard-mcp'

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