Skip to main content
Glama

list_organization_projects_v2

Fetch and organize GitHub projects within an organization using GraphQL API, supports pagination and customizable sorting by creation or update date.

Instructions

List projects V2 in a GitHub organization using GraphQL API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoCursor for pagination
firstNoNumber of projects to fetch (max 100)
orderByNoHow to order the projects
orgYesOrganization name

Implementation Reference

  • Executes GraphQL query to list Projects V2 for a GitHub organization, handling pagination and errors.
    export async function listOrganizationProjectsV2(
      org: string,
      first: number = 20,
      after?: string,
      orderBy?: { field: string, direction: string }
    ) {
      try {
        const query = `
          query($org: String!, $first: Int!, $after: String, $orderBy: ProjectV2Order) {
            organization(login: $org) {
              projectsV2(first: $first, after: $after, orderBy: $orderBy) {
                pageInfo {
                  hasNextPage
                  endCursor
                }
                nodes {
                  id
                  title
                  shortDescription
                  url
                  closed
                  createdAt
                  updatedAt
                  number
                }
              }
            }
          }
        `;
    
        const variables = { org, first, after, orderBy };
        const response = await graphqlRequest(query, variables);
    
        return response.data.organization.projectsV2;
      } catch (error) {
        if (error instanceof GitHubError) {
          throw error;
        }
    
        throw new GitHubError(
          `Failed to list organization projects v2: ${(error as Error).message}`,
          500,
          { error: (error as Error).message }
        );
      }
    }
  • Zod schema defining input parameters for the list_organization_projects_v2 tool.
    export const ListOrganizationProjectsV2Schema = z.object({
      org: z.string().describe("Organization name"),
      first: z.number().optional().describe("Number of projects to fetch (max 100)"),
      after: z.string().optional().describe("Cursor for pagination"),
      orderBy: z.object({
        field: z.enum(["CREATED_AT", "UPDATED_AT"]),
        direction: z.enum(["ASC", "DESC"])
      }).optional().describe("How to order the projects")
    });
  • index.ts:270-274 (registration)
    Registers the tool in the MCP server's listTools response with name, description, and input schema.
    {
      name: "list_organization_projects_v2",
      description: "List projects V2 in a GitHub organization using GraphQL API",
      inputSchema: zodToJsonSchema(projectsV2.ListOrganizationProjectsV2Schema),
    },
  • index.ts:735-746 (registration)
    Dispatches the tool call in the MCP server's callTool handler, parsing args and invoking the handler function.
    case "list_organization_projects_v2": {
      const args = projectsV2.ListOrganizationProjectsV2Schema.parse(request.params.arguments);
      const result = await projectsV2.listOrganizationProjectsV2(
        args.org,
        args.first,
        args.after,
        args.orderBy
      );
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions 'GraphQL API' which hints at the underlying technology, but doesn't describe key behaviors: whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior beyond the schema, or what the output looks like. For a list operation with no annotations, this leaves significant gaps.

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 with zero wasted words. It's appropriately sized for a list operation and front-loads the core purpose immediately. Every word earns its place in conveying the essential information.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format, error conditions, or behavioral characteristics needed for proper use. The mention of 'GraphQL API' provides some context but doesn't compensate for the missing behavioral and output information that would help an agent use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain parameter relationships, default values, or usage patterns. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't add value but the schema compensates.

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 action ('List') and resource ('projects V2 in a GitHub organization'), and specifies the API method ('using GraphQL API'). It distinguishes from the sibling 'list_organization_projects' by indicating this is a 'V2' version, though it doesn't explicitly contrast their differences. The purpose is specific but could better differentiate from the non-V2 sibling.

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 like 'list_organization_projects' or other project-listing tools. It mentions 'GraphQL API' but doesn't explain why this matters or when to choose this over REST-based tools. No explicit when/when-not instructions or prerequisites are included.

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

Related 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/tuanle96/mcp-github'

If you have feedback or need assistance with the MCP directory API, please join our Discord server