Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes

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>;
  • Registration of the listProjectFieldsTool in the central ToolRegistry during initialization of built-in tools.
    this.registerTool(listProjectFieldsTool);
  • 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"
          }
        }
      ]
    };

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