list_project_fields
Retrieve all field definitions from a GitHub project to understand its structure and available data points for project management.
Instructions
List all fields in a GitHub project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes |
Input Schema (JSON Schema)
{
"properties": {
"projectId": {
"type": "string"
}
},
"required": [
"projectId"
],
"type": "object"
}
Implementation Reference
- The core handler function that implements the list_project_fields tool logic. It fetches the specified GitHub project using the project repository and returns its custom fields array, handling errors appropriately.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); } }
- Zod schema definition for validating the input arguments to the list_project_fields tool (requires projectId).// Schema for list_project_fields tool export const listProjectFieldsSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), }); export type ListProjectFieldsArgs = z.infer<typeof listProjectFieldsSchema>;
- src/infrastructure/tools/ToolRegistry.ts:170-170 (registration)Registration of the listProjectFieldsTool in the central ToolRegistry during initialization of built-in tools.this.registerTool(listProjectFieldsTool);
- src/index.ts:255-256 (handler)Dispatcher in the main MCP server that routes call_tool requests for list_project_fields to the ProjectManagementService handler.case "list_project_fields": return await this.service.listProjectFields(args);
- Full tool definition including name, description, schema reference, and usage examples for MCP tool listing and validation.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" } } ] };