Skip to main content
Glama

list_projects

Retrieve and filter GitHub repository projects by state to manage project organization and track progress.

Instructions

List projects for a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
stateNoFilter projects by state
per_pageNoResults per page (max 100)
pageNoPage number of the results

Implementation Reference

  • Core handler function that executes the list_projects tool: constructs GitHub API URL for repo projects, appends query params, makes authenticated request, parses response with ProjectSchema array.
    export async function listProjects(
      github_pat: string,
      owner: string,
      repo: string,
      options: {
        state?: "open" | "closed" | "all";
        per_page?: number;
        page?: number;
      } = {}
    ): Promise<z.infer<typeof ProjectSchema>[]> {
      const url = new URL(`https://api.github.com/repos/${owner}/${repo}/projects`);
      
      if (options.state) url.searchParams.append("state", options.state);
      if (options.per_page) url.searchParams.append("per_page", options.per_page.toString());
      if (options.page) url.searchParams.append("page", options.page.toString());
      
      const response = await githubRequest(
        github_pat,
        url.toString(),
        {
          headers: {
            "Accept": "application/vnd.github.inertia-preview+json",
          },
        }
      );
      return z.array(ProjectSchema).parse(response);
    }
  • Zod input schemas for list_projects: public ListProjectsSchema (owner, repo, state, per_page, page) and internal _ListProjectsSchema extending with github_pat.
    export const ListProjectsSchema = z.object({
      owner: z.string().describe("Repository owner (username or organization)"),
      repo: z.string().describe("Repository name"),
      state: z.enum(["open", "closed", "all"]).optional().describe("Filter projects by state"),
      per_page: z.number().optional().describe("Results per page (max 100)"),
      page: z.number().optional().describe("Page number of the results"),
    });
    
    export const _ListProjectsSchema = ListProjectsSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • src/index.ts:249-253 (registration)
    Tool registration in the listTools response: defines name, description, and converts ListProjectsSchema to JSON schema for MCP protocol.
    {
      name: "list_projects",
      description: "List projects for a repository",
      inputSchema: zodToJsonSchema(projects.ListProjectsSchema),
    },
  • Wrapper handler in main CallToolRequest switch: parses arguments with _ListProjectsSchema, extracts params, calls projects.listProjects, formats result as MCP content.
    case "list_projects": {
      const args = projects._ListProjectsSchema.parse(params.arguments);
      const { github_pat, owner, repo, ...options } = args;
      const result = await projects.listProjects(github_pat, owner, repo, options);
      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 'List projects' but doesn't disclose behavioral traits such as pagination behavior (implied by 'per_page' and 'page' parameters), rate limits, authentication needs, or what the output looks like (e.g., format, fields). The description is minimal and lacks critical operational context for a tool with multiple parameters.

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 waste. It's front-loaded with the core action and resource, making it easy to parse. No extraneous information is included, and it directly conveys the tool's purpose without redundancy.

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 complexity (5 parameters, no annotations, no output schema), the description is incomplete. It lacks information on output format, pagination behavior, error handling, and when to use versus siblings. For a list operation with filtering and pagination, more context is needed to guide effective use by an AI agent.

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 5 parameters (owner, repo, state, per_page, page) with descriptions and enums. The description adds no additional meaning beyond the schema, as it doesn't explain parameter interactions or usage examples. Baseline 3 is appropriate when the 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 'List projects for a repository' clearly states the verb ('List') and resource ('projects'), specifying the scope ('for a repository'). It distinguishes from siblings like 'create_project' or 'list_project_columns' by focusing on listing rather than creating or listing columns. However, it doesn't explicitly differentiate from other list tools (e.g., 'list_issues'), which slightly reduces specificity.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context for filtering by state, or comparisons to similar tools like 'list_project_columns' or 'create_project'. Usage is implied by the name and parameters but not explicitly stated.

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

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