Skip to main content
Glama

github_agent_tasks_list_tasks

List GitHub tasks with options to paginate, sort, and filter by state, archive status, or update time.

Instructions

List tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
per_pageNoThe number of results per page (max 100).
pageNoThe page number of the results to fetch.
sortNoThe field to sort results by. Can be `updated_at` or `created_at`.
directionNoThe direction to sort results. Can be `asc` or `desc`.
stateNoComma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`.
is_archivedNoFilter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`.
sinceNoOnly show tasks updated at or after this time (ISO 8601 timestamp)

Implementation Reference

  • The handler function for the 'github_agent_tasks_list_tasks' tool. Makes a GET request to `/agents/tasks` with optional query parameters (per_page, page, sort, direction, state, is_archived, since).
    {
      name: "github_agent_tasks_list_tasks",
      description: "List tasks",
      inputSchema: z.object({
        per_page: z.number().optional().describe("The number of results per page (max 100)."),
        page: z.number().optional().describe("The page number of the results to fetch."),
        sort: z.enum(["updated_at", "created_at"]).optional().describe("The field to sort results by. Can be `updated_at` or `created_at`."),
        direction: z.enum(["asc", "desc"]).optional().describe("The direction to sort results. Can be `asc` or `desc`."),
        state: z.string().optional().describe("Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`."),
        is_archived: z.boolean().optional().describe("Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`."),
        since: z.string().optional().describe("Only show tasks updated at or after this time (ISO 8601 timestamp)")
      }),
      handler: async (args: Record<string, any>) => {
        return githubRequest("GET", `/agents/tasks`, undefined, { per_page: args.per_page, page: args.page, sort: args.sort, direction: args.direction, state: args.state, is_archived: args.is_archived, since: args.since });
      },
    },
  • The input schema (Zod object) for the tool, defining optional parameters: per_page, page, sort, direction, state, is_archived, since.
    {
      name: "github_agent_tasks_list_tasks",
      description: "List tasks",
      inputSchema: z.object({
        per_page: z.number().optional().describe("The number of results per page (max 100)."),
        page: z.number().optional().describe("The page number of the results to fetch."),
        sort: z.enum(["updated_at", "created_at"]).optional().describe("The field to sort results by. Can be `updated_at` or `created_at`."),
        direction: z.enum(["asc", "desc"]).optional().describe("The direction to sort results. Can be `asc` or `desc`."),
        state: z.string().optional().describe("Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`."),
        is_archived: z.boolean().optional().describe("Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`."),
        since: z.string().optional().describe("Only show tasks updated at or after this time (ISO 8601 timestamp)")
      }),
      handler: async (args: Record<string, any>) => {
        return githubRequest("GET", `/agents/tasks`, undefined, { per_page: args.per_page, page: args.page, sort: args.sort, direction: args.direction, state: args.state, is_archived: args.is_archived, since: args.since });
      },
    },
  • The tool is part of the `agentTasksTools` array exported from src/tools/agent-tasks.ts. The array is re-exported via src/tools/index.ts (line 4) and imported in src/index.ts (line 7) where it's included in the `allToolModules` array under category 'agent-tasks' (line 58). The actual registration to the MCP server happens at src/index.ts lines 110-130 via server.tool().
    export const agentTasksTools = [
      {
        name: "github_agent_tasks_list_tasks_for_repo",
        description: "List tasks for repository",
        inputSchema: z.object({
          owner: z.string().describe("owner"),
          repo: z.string().describe("repo"),
          per_page: z.number().optional().describe("The number of results per page (max 100)."),
          page: z.number().optional().describe("The page number of the results to fetch."),
          sort: z.enum(["updated_at", "created_at"]).optional().describe("The field to sort results by. Can be `updated_at` or `created_at`."),
          direction: z.enum(["asc", "desc"]).optional().describe("The direction to sort results. Can be `asc` or `desc`."),
          state: z.string().optional().describe("Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`."),
          is_archived: z.boolean().optional().describe("Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`."),
          since: z.string().optional().describe("Only show tasks updated at or after this time (ISO 8601 timestamp)"),
          creator_id: z.number().optional().describe("Filter tasks by creator user ID")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/agents/repos/${args.owner}/${args.repo}/tasks`, undefined, { per_page: args.per_page, page: args.page, sort: args.sort, direction: args.direction, state: args.state, is_archived: args.is_archived, since: args.since, creator_id: args.creator_id });
        },
      },
      {
        name: "github_agent_tasks_create_task",
        description: "Create a task",
        inputSchema: z.object({
          owner: z.string().describe("owner"),
          repo: z.string().describe("repo"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("POST", `/agents/repos/${args.owner}/${args.repo}/tasks`, args.body, undefined);
        },
      },
      {
        name: "github_agent_tasks_get_task_by_repo_and_id",
        description: "Get a task by repo",
        inputSchema: z.object({
          owner: z.string().describe("owner"),
          repo: z.string().describe("repo"),
          task_id: z.string().describe("task_id")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/agents/repos/${args.owner}/${args.repo}/tasks/${args.task_id}`, undefined, undefined);
        },
      },
      {
        name: "github_agent_tasks_list_tasks",
        description: "List tasks",
        inputSchema: z.object({
          per_page: z.number().optional().describe("The number of results per page (max 100)."),
          page: z.number().optional().describe("The page number of the results to fetch."),
          sort: z.enum(["updated_at", "created_at"]).optional().describe("The field to sort results by. Can be `updated_at` or `created_at`."),
          direction: z.enum(["asc", "desc"]).optional().describe("The direction to sort results. Can be `asc` or `desc`."),
          state: z.string().optional().describe("Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`."),
          is_archived: z.boolean().optional().describe("Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`."),
          since: z.string().optional().describe("Only show tasks updated at or after this time (ISO 8601 timestamp)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/agents/tasks`, undefined, { per_page: args.per_page, page: args.page, sort: args.sort, direction: args.direction, state: args.state, is_archived: args.is_archived, since: args.since });
        },
      },
      {
        name: "github_agent_tasks_get_task_by_id",
        description: "Get a task by ID",
        inputSchema: z.object({
          task_id: z.string().describe("task_id")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/agents/tasks/${args.task_id}`, undefined, undefined);
        },
      },
    ];
  • The `githubRequest` helper function used by the handler to make authenticated HTTP requests to the GitHub API.
    export async function githubRequest<T>(
      method: string,
      path: string,
      body?: Record<string, unknown>,
      params?: Record<string, string | number | boolean | string[] | undefined>
    ): Promise<T> {
      const url = new URL(`${BASE_URL}${path}`);
    
      if (params) {
        for (const [key, value] of Object.entries(params)) {
          if (value === undefined || value === null || value === "") continue;
          if (Array.isArray(value)) {
            url.searchParams.set(key, value.join(","));
          } else {
            url.searchParams.set(key, String(value));
          }
        }
      }
    
      const headers: Record<string, string> = {
        Authorization: `Bearer ${getToken()}`,
        Accept: "application/vnd.github+json",
        "X-GitHub-Api-Version": "2022-11-28",
        "User-Agent": "github-mcp/1.0.0",
      };
    
      if (body) {
        headers["Content-Type"] = "application/json";
      }
    
      const res = await fetch(url.toString(), {
        method,
        headers,
        body: body ? JSON.stringify(body) : undefined,
      });
    
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        let detail = text;
        try {
          const json = JSON.parse(text);
          detail = json.message || text;
          if (json.errors) detail += ` -- ${JSON.stringify(json.errors)}`;
        } catch {}
        throw new Error(`GitHub API error ${res.status}: ${detail}`);
      }
    
      if (res.status === 204) return {} as T;
    
      return res.json() as Promise<T>;
    }
  • src/index.ts:110-130 (registration)
    The MCP server registration loop - iterates over all tools and calls server.tool() with the tool's name, description, schema, and handler, wrapping the handler result in a text content response.
    for (const tool of allTools) {
      server.tool(
        tool.name,
        tool.description,
        tool.inputSchema.shape as any,
        async (args: any) => {
          try {
            const result = await tool.handler(args as any);
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (err) {
            const message = err instanceof Error ? err.message : String(err);
            return {
              content: [{ type: "text" as const, text: `Error: ${message}` }],
              isError: true,
            };
          }
        }
      );
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits such as read-only nature, authentication requirements, or rate limits. It provides none, leaving the agent uninformed about what 'list' entails beyond a generic name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a mere two words, which is insufficient to convey necessary context. It is under-specified rather than concise, failing to front-load critical details like scope or usage.

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

Completeness1/5

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

The description is severely incomplete. It lacks information about what tasks are listed (global vs scoped), authentication needs, default behavior (e.g., all tasks vs paginated), and how it differs from sibling tools. With a rich set of parameters (7), more guidance is essential.

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?

Input schema has 100% description coverage, so parameters are well-documented. The description adds no extra meaning beyond the schema, meeting the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List tasks' is vague and does not specify what tasks are being listed (e.g., global, org, or user tasks). It fails to distinguish from sibling tool 'github_agent_tasks_list_tasks_for_repo', which explicitly scopes to a repository.

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

Usage Guidelines1/5

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

No usage guidance is provided. The description does not indicate when to use this tool versus alternatives like 'github_agent_tasks_list_tasks_for_repo' or 'github_agent_tasks_get_task_by_id'.

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

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