Skip to main content
Glama

taskGetAll

Retrieve all tasks from the task list to manage and track project activities.

Instructions

獲取所有任務列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.ts:603-619 (registration)
    Registers the 'taskGetAll' tool including its description, empty input schema (no parameters), and inline async handler function that calls TaskManagerTool.getAllTasks() to retrieve all tasks and returns formatted text content or error message.
    server.tool("taskGetAll",
        "獲取所有任務列表",
        {},
        async () => {
            try {
                const tasks = await TaskManagerTool.getAllTasks();
    
                return {
                    content: [{ type: "text", text: `獲取到 ${tasks.length} 個任務:\n${JSON.stringify(tasks, null, 2)}` }]
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `獲取任務失敗: ${error instanceof Error ? error.message : "未知錯誤"}` }]
                };
            }
        }
    );
  • Static method getAllTasks() that implements the core logic for fetching all tasks by calling the private readTasks() method.
    public static async getAllTasks(): Promise<Task[]> {
      return await this.readTasks();
    }
  • Private helper method readTasks() that ensures the tasks directory exists and reads/parses the tasks.json file to return the array of Task objects.
    private static async readTasks(): Promise<Task[]> {
      await this.ensureTasksDirectory();
    
      try {
        const tasksFile = this.getTasksFilePath();
        const fileContent = fs.readFileSync(tasksFile, 'utf-8');
        const data = JSON.parse(fileContent);
        return data.tasks || [];
      } catch (error) {
        console.error('Error reading tasks:', error);
        throw new Error(`讀取任務失敗: ${error instanceof Error ? error.message : '未知錯誤'}`);
      }
    }
  • TypeScript interface definition for Task type, which structures the data returned by getAllTasks(), including related TaskStep, TaskStatus enum.
    export interface Task {
      /**
       * 任務唯一識別碼
       */
      id: string;
      
      /**
       * 任務標題
       */
      title: string;
      
      /**
       * 任務詳細描述
       */
      description: string;
      
      /**
       * 任務步驟列表
       */
      steps: TaskStep[];
      
      /**
       * 任務標籤列表
       */
      tags: string[];
      
      /**
       * 任務建立時間
       */
      createdAt: string;
      
      /**
       * 任務更新時間
       */
      updatedAt: string;
      
      /**
       * 任務期限時間
       */
      dueDate?: string;
        /**
         * 預計開始時間
         */
        plannedStartDate?: string;
        /**
         * 實際開始時間
         */
        actualStartDate?: string;
          /**
           * 實際完成時間
           */
          actualCompletionDate?: string;
    
      
      
      /**
       * 任務狀態
       */
      status: TaskStatus;
      
      /**
       * 任務優先級 (1-5, 1為最高)
       */
      priority: number;
    }
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 states a read operation ('獲取' - get) but doesn't disclose behavioral traits such as whether it's paginated, sorted, or includes metadata. For a list operation with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is a single, efficient sentence ('獲取所有任務列表') with no wasted words. It's appropriately sized for a simple tool, though it could be slightly more informative without losing conciseness.

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 (simple read operation) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'all tasks' includes (e.g., status, fields returned) or behavioral aspects like performance implications. For a tool in a context with sibling alternatives, more guidance is needed.

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

Parameters4/5

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

With 0 parameters and 100% schema description coverage, the baseline is 4. The description doesn't need to add parameter semantics, and it appropriately doesn't mention any parameters, aligning with the empty input schema.

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

Purpose3/5

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

The description '獲取所有任務列表' (Get all task list) states a clear verb ('獲取' - get) and resource ('任務列表' - task list), but it's vague about scope and doesn't distinguish from sibling tools like taskGetById or taskSearch. It specifies '所有' (all) which implies no filtering, but lacks precision about what 'all' encompasses.

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 like taskGetById (for specific tasks) or taskSearch (for filtered searches). The description implies it retrieves all tasks, but doesn't clarify use cases or exclusions, leaving the agent to infer usage from context alone.

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/GonTwVn/GonMCPtool'

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