Skip to main content
Glama

update_project_view

Modify a GitHub project view's name or layout to organize tasks and track progress effectively.

Instructions

Update a view in a GitHub project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
viewIdYes
nameNo
layoutNo

Implementation Reference

  • The core handler function that executes the GitHub GraphQL mutation to update a project view's name and/or layout.
    async updateProjectView(data: {
      projectId: string;
      viewId: string;
      name?: string;
      layout?: 'board' | 'table' | 'timeline' | 'roadmap';
    }): Promise<ProjectView> {
      try {
        const mutation = `
          mutation($input: UpdateProjectV2ViewInput!) {
            updateProjectV2View(input: $input) {
              projectV2View {
                id
                name
                layout
              }
            }
          }
        `;
    
        interface UpdateViewResponse {
          updateProjectV2View: {
            projectV2View: {
              id: string;
              name: string;
              layout: string;
            }
          }
        }
    
        const input: Record<string, any> = {
          projectId: data.projectId,
          id: data.viewId
        };
    
        if (data.name) {
          input.name = data.name;
        }
    
        if (data.layout) {
          input.layout = data.layout.toUpperCase();
        }
    
        const response = await this.factory.graphql<UpdateViewResponse>(mutation, {
          input
        });
    
        const view = response.updateProjectV2View.projectV2View;
    
        return {
          id: view.id,
          name: view.name,
          layout: view.layout.toLowerCase() as 'board' | 'table' | 'timeline' | 'roadmap',
          fields: [],
          sortBy: [],
          groupBy: undefined,
          filters: []
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema defining input arguments for the update_project_view tool: projectId, viewId, optional name and layout.
    // Schema for update_project_view tool
    export const updateProjectViewSchema = z.object({
      projectId: z.string().min(1, "Project ID is required"),
      viewId: z.string().min(1, "View ID is required"),
      name: z.string().optional(),
      layout: z.enum(["board", "table", "timeline", "roadmap"]).optional(),
    });
    
    export type UpdateProjectViewArgs = z.infer<typeof updateProjectViewSchema>;
  • Registers the updateProjectViewTool in the central ToolRegistry during initialization.
    this.registerTool(updateProjectViewTool);
  • src/index.ts:329-330 (registration)
    Tool dispatcher in main server that routes 'update_project_view' calls to ProjectManagementService.updateProjectView.
    case "update_project_view":
      return await this.service.updateProjectView(args);
  • ToolDefinition export including name, description, schema reference, and usage examples for update_project_view.
    export const updateProjectViewTool: ToolDefinition<UpdateProjectViewArgs> = {
      name: "update_project_view",
      description: "Update a view in a GitHub project",
      schema: updateProjectViewSchema as unknown as ToolSchema<UpdateProjectViewArgs>,
      examples: [
        {
          name: "Update view to timeline",
          description: "Change a view's name and layout to timeline",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            viewId: "PVV_lADOLhQ7gc4AOEbHzM4AOAL9",
            name: "Development Timeline",
            layout: "timeline"
          }
        }
      ]
    };

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