Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

get_field_value

Retrieve specific field values from GitHub project items, including text, numbers, dates, selections, iterations, milestones, assignees, and labels.

Instructions

Get a field value for a GitHub project item. Supports reading all field types: TEXT, NUMBER, DATE, SINGLE_SELECT, ITERATION, MILESTONE, ASSIGNEES, LABELS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
itemIdYes
fieldIdYes

Implementation Reference

  • The core handler implementation for the get_field_value tool. Uses GitHub GraphQL API to query and return the value of a specific field on a project item, handling all supported field types (text, number, date, single-select, iteration, milestone, assignees, labels).
    async getFieldValue(data: {
      projectId: string;
      itemId: string;
      fieldId: string;
    }): Promise<{ fieldName: string; value: any; fieldType: string }> {
      try {
        const query = `
          query($projectId: ID!, $itemId: ID!, $fieldId: ID!) {
            node(id: $projectId) {
              ... on ProjectV2 {
                item(id: $itemId) {
                  fieldValueByName(name: $fieldId) {
                    ... on ProjectV2ItemFieldTextValue {
                      text
                      field {
                        ... on ProjectV2Field {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldNumberValue {
                      number
                      field {
                        ... on ProjectV2Field {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldDateValue {
                      date
                      field {
                        ... on ProjectV2Field {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldSingleSelectValue {
                      name
                      field {
                        ... on ProjectV2SingleSelectField {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldIterationValue {
                      iterationId
                      title
                      field {
                        ... on ProjectV2IterationField {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldMilestoneValue {
                      milestoneId
                      title
                      field {
                        ... on ProjectV2MilestoneField {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldUserValue {
                      users {
                        nodes {
                          id
                          login
                        }
                      }
                      field {
                        ... on ProjectV2AssigneesField {
                          name
                          dataType
                        }
                      }
                    }
                    ... on ProjectV2ItemFieldLabelValue {
                      labels {
                        nodes {
                          id
                          name
                        }
                      }
                      field {
                        ... on ProjectV2LabelsField {
                          name
                          dataType
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        `;
    
        interface FieldValueResponse {
          node: {
            item: {
              fieldValueByName: {
                text?: string;
                number?: number;
                date?: string;
                name?: string;
                iterationId?: string;
                title?: string;
                milestoneId?: string;
                users?: {
                  nodes: Array<{
                    id: string;
                    login: string;
                  }>;
                };
                labels?: {
                  nodes: Array<{
                    id: string;
                    name: string;
                  }>;
                };
                field: {
                  name: string;
                  dataType: string;
                }
              }
            }
          }
        }
    
        const response = await this.factory.graphql<FieldValueResponse>(query, {
          projectId: data.projectId,
          itemId: data.itemId,
          fieldId: data.fieldId
        });
    
        if (!response.node?.item?.fieldValueByName) {
          throw new ResourceNotFoundError(ResourceType.FIELD, data.fieldId);
        }
    
        const fieldValue = response.node.item.fieldValueByName;
        const field = fieldValue.field;
        let value = null;
    
        // Extract the value based on the field type
        if ('text' in fieldValue && fieldValue.text !== undefined) {
          value = fieldValue.text;
        } else if ('number' in fieldValue && fieldValue.number !== undefined) {
          value = fieldValue.number;
        } else if ('date' in fieldValue && fieldValue.date !== undefined) {
          value = fieldValue.date;
        } else if ('name' in fieldValue && fieldValue.name !== undefined) {
          value = fieldValue.name;
        } else if ('iterationId' in fieldValue && fieldValue.iterationId !== undefined) {
          value = {
            iterationId: fieldValue.iterationId,
            title: fieldValue.title
          };
        } else if ('milestoneId' in fieldValue && fieldValue.milestoneId !== undefined) {
          value = {
            milestoneId: fieldValue.milestoneId,
            title: fieldValue.title
          };
        } else if ('users' in fieldValue && fieldValue.users?.nodes) {
          value = fieldValue.users.nodes.map(user => ({
            id: user.id,
            login: user.login
          }));
        } else if ('labels' in fieldValue && fieldValue.labels?.nodes) {
          value = fieldValue.labels.nodes.map(label => ({
            id: label.id,
            name: label.name
          }));
        }
    
        return {
          fieldName: field.name,
          value,
          fieldType: field.dataType
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • ToolDefinition including input schema (zod), description, and examples for get_field_value. Input requires projectId, itemId, fieldId.
    export const getFieldValueTool: ToolDefinition<GetFieldValueArgs> = {
      name: "get_field_value",
      description: "Get a field value for a GitHub project item. Supports reading all field types: TEXT, NUMBER, DATE, SINGLE_SELECT, ITERATION, MILESTONE, ASSIGNEES, LABELS",
      schema: getFieldValueSchema as unknown as ToolSchema<GetFieldValueArgs>,
      examples: [
        {
          name: "Get text field value",
          description: "Get the current text value for an item",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI1"
          }
        },
        {
          name: "Get status field value",
          description: "Get the current status (single select) value for an item",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI2"
          }
        },
        {
          name: "Get iteration field value",
          description: "Get the current iteration/sprint assignment for an item",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI3"
          }
        },
        {
          name: "Get milestone field value",
          description: "Get the current milestone assignment for an item",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI4"
          }
        },
        {
          name: "Get assignees field value",
          description: "Get the current assignees for an item",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI5"
          }
        },
        {
          name: "Get labels field value",
          description: "Get the current labels for an item",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI6"
          }
        }
      ]
    };
  • Registers the getFieldValueTool in the central ToolRegistry singleton.
    this.registerTool(getFieldValueTool);
  • MCP server dispatch handler that routes get_field_value calls to the ProjectManagementService.getFieldValue method.
    case "get_field_value":
      return await this.service.getFieldValue(args);
  • Zod input schema validation for get_field_value tool parameters.
    export const getFieldValueSchema = z.object({
      projectId: z.string().min(1, "Project ID is required"),
      itemId: z.string().min(1, "Item ID is required"),
      fieldId: z.string().min(1, "Field ID is required"),
    });
    
    export type GetFieldValueArgs = z.infer<typeof getFieldValueSchema>;
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions supporting all field types, which adds useful context about capabilities, but doesn't disclose behavioral traits like error handling, permissions needed, rate limits, or what happens if parameters are invalid. This is a significant gap for a tool with no annotation coverage.

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, efficient sentence with zero waste. It's front-loaded with the core purpose and includes additional useful detail about supported field types, making it appropriately sized and well-structured.

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?

Given the tool's complexity (3 required parameters), lack of annotations, and no output schema, the description is incomplete. It covers the 'what' but misses critical context like parameter semantics, behavioral details, and return values, leaving gaps that could hinder correct tool 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 schema provides no parameter details. The description doesn't add any meaning to the parameters (projectId, itemId, fieldId)—it doesn't explain what these IDs represent, how to obtain them, or their format. This leaves all three parameters undocumented, failing to compensate for the low coverage.

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 verb ('Get') and resource ('field value for a GitHub project item'), making the purpose specific and understandable. It distinguishes from siblings like 'set_field_value' and 'clear_field_value' by focusing on reading, though it doesn't explicitly name these alternatives.

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?

Usage is implied by the description's focus on reading field values, suggesting it's for retrieval rather than modification. However, it lacks explicit guidance on when to use this versus alternatives like 'list_project_fields' or 'get_project', and doesn't mention prerequisites or exclusions.

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/kunwarVivek/mcp-github-project-manager'

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