list_project_fields
Retrieve all fields within a GitHub project to manage custom attributes, track tasks, and organize workflows effectively using GitHub Projects V2 integration.
Instructions
List all fields in a GitHub project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes |
Implementation Reference
- The main handler function that retrieves and returns the list of custom fields for a given GitHub project ID by fetching the project via repository and extracting its fields array.async listProjectFields(data: { projectId: string; }): Promise<CustomField[]> { try { const project = await this.projectRepo.findById(data.projectId); if (!project) { throw new ResourceNotFoundError(ResourceType.PROJECT, data.projectId); } return project.fields || []; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Tool definition including name, description, input schema (requiring projectId), and example usage for listing project fields.export const listProjectFieldsTool: ToolDefinition<ListProjectFieldsArgs> = { name: "list_project_fields", description: "List all fields in a GitHub project", schema: listProjectFieldsSchema as unknown as ToolSchema<ListProjectFieldsArgs>, examples: [ { name: "List project fields", description: "Get all fields for a specific project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:243-243 (registration)Registers the listProjectFieldsTool in the central ToolRegistry singleton during built-in tools initialization.this.registerTool(listProjectFieldsTool);
- src/index.ts:280-281 (handler)MCP tool dispatch handler that routes 'list_project_fields' calls to the ProjectManagementService.listProjectFields method.case "list_project_fields": return await this.service.listProjectFields(args);