Skip to main content
Glama

list_project_views

Retrieve all views in a GitHub project to organize and manage project data effectively.

Instructions

List all views in a GitHub project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes

Implementation Reference

  • The main handler function that executes the tool logic by querying GitHub GraphQL API for project views and mapping the response to ProjectView objects.
    async listProjectViews(data: {
      projectId: string;
    }): Promise<ProjectView[]> {
      try {
        const query = `
          query($projectId: ID!) {
            node(id: $projectId) {
              ... on ProjectV2 {
                views(first: 20) {
                  nodes {
                    id
                    name
                    layout
                  }
                }
              }
            }
          }
        `;
    
        interface ListViewsResponse {
          node: {
            views: {
              nodes: Array<{
                id: string;
                name: string;
                layout: string;
              }>
            }
          }
        }
    
        const response = await this.factory.graphql<ListViewsResponse>(query, {
          projectId: data.projectId
        });
    
        if (!response.node?.views?.nodes) {
          return [];
        }
    
        return response.node.views.nodes.map(view => ({
          id: view.id,
          name: view.name,
          layout: view.layout.toLowerCase() as 'board' | 'table' | 'timeline' | 'roadmap',
          fields: [], // These would need to be fetched separately if needed
          sortBy: [],
          groupBy: undefined,
          filters: []
        }));
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema defining the input arguments for the list_project_views tool (requires projectId).
    // Schema for list_project_views tool
    export const listProjectViewsSchema = z.object({
      projectId: z.string().min(1, "Project ID is required"),
    });
    
    export type ListProjectViewsArgs = z.infer<typeof listProjectViewsSchema>;
  • Imports and registers the listProjectViewsTool in the central ToolRegistry.
      listProjectViewsTool,
      updateProjectViewTool,
    
      // Milestone tools
      updateMilestoneTool,
      deleteMilestoneTool,
    
      // Sprint tools
      updateSprintTool,
      addIssuesToSprintTool,
      removeIssuesFromSprintTool,
    
      // Label tools
      createLabelTool,
      listLabelsTool,
    
      // AI task management tools
      addFeatureTool,
      generatePRDTool,
      parsePRDTool,
      getNextTaskTool,
      analyzeTaskComplexityTool,
      expandTaskTool,
      enhancePRDTool,
      createTraceabilityMatrixTool,
    } from "./ToolSchemas.js";
    
    /**
     * Central registry of all available tools
     */
    export class ToolRegistry {
      private static _instance: ToolRegistry;
      private _tools: Map<string, ToolDefinition<any>>;
    
      private constructor() {
        this._tools = new Map();
        this.registerBuiltInTools();
      }
    
      /**
       * Get the singleton instance
       */
      public static getInstance(): ToolRegistry {
        if (!ToolRegistry._instance) {
          ToolRegistry._instance = new ToolRegistry();
        }
        return ToolRegistry._instance;
      }
    
      /**
       * Register a new tool
       */
      public registerTool<T>(tool: ToolDefinition<T>): void {
        if (this._tools.has(tool.name)) {
          process.stderr.write(`Tool '${tool.name}' is already registered and will be overwritten.\n`);
        }
        this._tools.set(tool.name, tool);
      }
    
      /**
       * Get a tool by name
       */
      public getTool<T>(name: string): ToolDefinition<T> | undefined {
        return this._tools.get(name) as ToolDefinition<T> | undefined;
      }
    
      /**
       * Get all registered tools
       */
      public getAllTools(): ToolDefinition<any>[] {
        return Array.from(this._tools.values());
      }
    
      /**
       * Convert tools to MCP format for list_tools response
       */
      public getToolsForMCP(): Array<{
        name: string;
        description: string;
        inputSchema: any;
      }> {
        return this.getAllTools().map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: this.convertZodToJsonSchema(tool.schema),
        }));
      }
    
      /**
       * Register all built-in tools
       */
      private registerBuiltInTools(): void {
        // Register roadmap and planning tools
        this.registerTool(createRoadmapTool);
        this.registerTool(planSprintTool);
        this.registerTool(getMilestoneMetricsTool);
        this.registerTool(getSprintMetricsTool);
        this.registerTool(getOverdueMilestonesTool);
        this.registerTool(getUpcomingMilestonesTool);
    
        // Register project tools
        this.registerTool(createProjectTool);
        this.registerTool(listProjectsTool);
        this.registerTool(getProjectTool);
        this.registerTool(updateProjectTool);
        this.registerTool(deleteProjectTool);
    
        // Register milestone tools
        this.registerTool(createMilestoneTool);
        this.registerTool(listMilestonesTool);
        this.registerTool(updateMilestoneTool);
        this.registerTool(deleteMilestoneTool);
    
        // Register issue tools
        this.registerTool(createIssueTool);
        this.registerTool(listIssuesTool);
        this.registerTool(getIssueTool);
        this.registerTool(updateIssueTool);
    
        // Register sprint tools
        this.registerTool(createSprintTool);
        this.registerTool(listSprintsTool);
        this.registerTool(getCurrentSprintTool);
        this.registerTool(updateSprintTool);
        this.registerTool(addIssuesToSprintTool);
        this.registerTool(removeIssuesFromSprintTool);
    
        // Register project field tools
        this.registerTool(createProjectFieldTool);
        this.registerTool(listProjectFieldsTool);
        this.registerTool(updateProjectFieldTool);
    
        // Register project view tools
        this.registerTool(createProjectViewTool);
        this.registerTool(listProjectViewsTool);
  • Switch case dispatcher in executeToolHandler that routes the tool call to the ProjectManagementService.listProjectViews method.
    case "list_project_views":
      return await this.service.listProjectViews(args);
  • ToolDefinition object that defines the tool metadata including name, description, schema, and examples.
    export const listProjectViewsTool: ToolDefinition<ListProjectViewsArgs> = {
      name: "list_project_views",
      description: "List all views in a GitHub project",
      schema: listProjectViewsSchema as unknown as ToolSchema<ListProjectViewsArgs>,
      examples: [
        {
          name: "List project views",
          description: "Get all views for a specific project",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH"
          }
        }
      ]
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('List all views') but fails to describe key behaviors like whether this is a read-only operation, how results are formatted (e.g., pagination, sorting), or any rate limits. This leaves significant gaps in understanding the tool's behavior.

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 that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for a simple listing tool, making it easy to parse quickly.

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 low complexity (1 parameter, no output schema, no annotations), the description is incomplete. It lacks details on behavioral traits, parameter usage, and output format, which are essential for an agent to invoke the tool correctly. This makes it inadequate for practical use.

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?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It mentions 'in a GitHub project', which implies the 'projectId' parameter is required, but does not explain what format the ID should be (e.g., numeric, string), where to find it, or any constraints. This adds minimal value beyond the schema.

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 ('List') and resource ('views in a GitHub project'), making the purpose specific and understandable. However, it does not distinguish this tool from potential siblings like 'list_project_fields' or 'list_project_items', which also list project-related resources, leaving some ambiguity in differentiation.

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, such as 'list_project_items' or 'get_project', nor does it mention prerequisites like needing a valid project ID. Without such context, the agent lacks clear usage instructions.

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