Skip to main content
Glama

add_project_item

Add issues or pull requests to GitHub projects to organize development work and track implementation progress.

Instructions

Add an item to a GitHub project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
contentIdYes
contentTypeYes

Implementation Reference

  • Core handler function that executes the tool logic using GitHub GraphQL API mutation 'addProjectV2ItemById' to add an issue or pull request to a project.
    async addProjectItem(data: {
      projectId: string;
      contentId: string;
      contentType: 'issue' | 'pull_request';
    }): Promise<ProjectItem> {
      try {
        // GraphQL mutation to add an item to a project
        const mutation = `
          mutation($input: AddProjectV2ItemByIdInput!) {
            addProjectV2ItemById(input: $input) {
              item {
                id
                content {
                  ... on Issue {
                    id
                    title
                  }
                  ... on PullRequest {
                    id
                    title
                  }
                }
              }
            }
          }
        `;
    
        interface AddProjectItemResponse {
          addProjectV2ItemById: {
            item: {
              id: string;
              content: {
                id: string;
                title: string;
              };
            };
          };
        }
    
        const response = await this.factory.graphql<AddProjectItemResponse>(mutation, {
          input: {
            projectId: data.projectId,
            contentId: data.contentId
          }
        });
    
        const itemId = response.addProjectV2ItemById.item.id;
        const contentId = response.addProjectV2ItemById.item.content.id;
    
        const resourceType = data.contentType === 'issue' ? ResourceType.ISSUE : ResourceType.PULL_REQUEST;
    
        return {
          id: itemId,
          contentId,
          contentType: resourceType,
          projectId: data.projectId,
          fieldValues: {},
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString()
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema defining input validation for the tool: projectId, contentId, and contentType (issue or pull_request). Includes TypeScript type inference.
    // Schema for add_project_item tool
    export const addProjectItemSchema = z.object({
      projectId: z.string().min(1, "Project ID is required"),
      contentId: z.string().min(1, "Content ID is required"),
      contentType: z.enum(["issue", "pull_request"]),
    });
    
    export type AddProjectItemArgs = z.infer<typeof addProjectItemSchema>;
  • Registers the addProjectItemTool in the central ToolRegistry singleton instance.
    this.registerTool(addProjectItemTool);
  • Imports the addProjectItemTool from ToolSchemas for registration.
    addProjectItemTool,
  • Dispatcher in main server that routes tool calls to ProjectManagementService.addProjectItem.
    case "add_project_item":
      return await this.service.addProjectItem(args);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action is 'Add' (implying a write operation) but doesn't disclose permissions required, rate limits, whether the operation is idempotent, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is inadequate.

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 a single, clear sentence with zero wasted words. It's front-loaded with the core action and target, making it easy to parse. Every word earns its place, though it could benefit from additional context.

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

Completeness2/5

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

For a mutation tool with 3 required parameters, 0% schema coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'adding an item' entails operationally, what the parameters mean, or what to expect upon completion. The agent lacks critical context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'projectId', 'contentId', or 'contentType' represent, their formats, or relationships. The enum for 'contentType' is documented in the schema but not explained in the description, leaving semantics unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and target ('an item to a GitHub project'), making the purpose immediately understandable. It distinguishes from siblings like 'create_project' or 'update_project' by focusing on adding items to existing projects. However, it doesn't specify what types of items can be added beyond what's implied by the schema.

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 provides no guidance on when to use this tool versus alternatives like 'add_issues_to_sprint' or 'create_issue'. It doesn't mention prerequisites (e.g., needing an existing project) or exclusions. The agent must infer usage from the tool name alone.

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/HarshKumarSharma/MCP'

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