Skip to main content
Glama

list_organization_projects

Retrieve all projects within a GitHub organization, filtering by state and enabling pagination for efficient project management and organization-wide oversight.

Instructions

List all projects in a GitHub organization (at organization level, not repository level)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgYesOrganization name
pageNoPage number for pagination
per_pageNoNumber of results per page (max 100)
stateNoFilter projects by state

Implementation Reference

  • The main handler function that fetches and returns the list of projects for a given GitHub organization using the REST API.
    export async function listOrganizationProjects(org: string, state?: string, page?: number, perPage?: number) {
        try {
            const params: Record<string, string | number | undefined> = {};
    
            if (state) {
                params.state = state;
            }
    
            if (page) {
                params.page = page;
            }
    
            if (perPage) {
                params.per_page = perPage;
            }
    
            let url = `https://api.github.com/orgs/${org}/projects`;
    
            // Thêm query params nếu có
            if (Object.keys(params).length > 0) {
                const queryString = new URLSearchParams();
                Object.entries(params).forEach(([key, value]) => {
                    if (value !== undefined) {
                        queryString.append(key, String(value));
                    }
                });
                url += `?${queryString.toString()}`;
            }
    
            return await githubRequest(url, {
                headers: {
                    'Accept': 'application/vnd.github.inertia-preview+json'
                }
            });
        } catch (error) {
            if (error instanceof GitHubError) {
                throw error;
            }
    
            throw new GitHubError(`Failed to list organization projects: ${(error as Error).message}`, 500, { error: (error as Error).message });
        }
    } 
  • Zod schema defining the input parameters for the list_organization_projects tool.
    export const ListOrganizationProjectsSchema = z.object({
        org: z.string().describe("Organization name"),
        state: z.enum(["open", "closed", "all"]).optional().describe("Filter projects by state"),
        page: z.number().optional().describe("Page number for pagination"),
        per_page: z.number().optional().describe("Number of results per page (max 100)"),
    });
  • index.ts:266-269 (registration)
    Registers the list_organization_projects tool in the MCP server's list of available tools, including name, description, and input schema.
      name: "list_organization_projects",
      description: "List all projects in a GitHub organization (at organization level, not repository level)",
      inputSchema: zodToJsonSchema(projects.ListOrganizationProjectsSchema),
    },
  • index.ts:722-733 (registration)
    Dispatches the call to the listOrganizationProjects handler function when the tool is invoked.
    case "list_organization_projects": {
      const args = projects.ListOrganizationProjectsSchema.parse(request.params.arguments);
      const result = await projects.listOrganizationProjects(
        args.org,
        args.state,
        args.page,
        args.per_page
      );
      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. It mentions the scope ('organization level') but lacks critical behavioral details: it doesn't disclose that this is a read-only operation (implied by 'list'), doesn't mention authentication requirements, rate limits, pagination behavior beyond parameters, or what the output format looks like. For a tool with no annotation coverage, this is a significant gap.

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 front-loads the core purpose ('List all projects in a GitHub organization') and adds necessary scope clarification in parentheses. Every word earns its place with zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool with 4 parameters and sibling tools. It covers purpose and scope adequately but lacks behavioral context (e.g., read-only nature, auth needs, output format) and explicit differentiation from alternatives. For a list tool with moderate complexity, this is minimally viable but has clear gaps.

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 already documents all 4 parameters (org, page, per_page, state) with descriptions and enum for 'state.' The description adds no additional parameter semantics beyond what's in the schema, such as default values or constraints like 'max 100' for per_page (already in schema). Baseline 3 is appropriate when schema does the heavy lifting.

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 all projects') and resource ('in a GitHub organization'), with explicit scope clarification ('at organization level, not repository level'). It distinguishes from repository-level operations but doesn't explicitly differentiate from sibling tools like 'list_projects' or 'list_organization_projects_v2'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'at organization level, not repository level,' which helps differentiate from repository-scoped tools. However, it doesn't provide explicit guidance on when to use this versus similar sibling tools like 'list_projects' or 'list_organization_projects_v2,' nor does it mention prerequisites or exclusions.

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