Skip to main content
Glama
robertn702

Sunsama MCP Server

get-archived-tasks

Retrieve archived tasks from Sunsama with pagination controls to manage large collections of completed or historical work items.

Instructions

Get archived tasks with optional pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of tasks to return (defaults to 100)
offsetNoPagination offset (defaults to 0)

Implementation Reference

  • The core handler implementation for the 'get-archived-tasks' tool. It uses pagination (offset/limit), fetches from client.getArchivedTasks, trims tasks, and returns formatted TSV with pagination metadata.
    export const getArchivedTasksTool = withTransportClient({
      name: "get-archived-tasks",
      description: "Get archived tasks with optional pagination",
      parameters: getArchivedTasksSchema,
      execute: async (
        { offset = 0, limit = 100 }: GetArchivedTasksInput,
        context: ToolContext,
      ) => {
        const requestedLimit = limit;
        const fetchLimit = requestedLimit + 1;
    
        const allTasks = await context.client.getArchivedTasks(offset, fetchLimit);
    
        const hasMore = allTasks.length > requestedLimit;
        const tasks = hasMore ? allTasks.slice(0, requestedLimit) : allTasks;
        const trimmedTasks = trimTasksForResponse(tasks);
    
        const paginationInfo = {
          offset,
          limit: requestedLimit,
          count: tasks.length,
          hasMore,
          nextOffset: hasMore ? offset + requestedLimit : null,
        };
    
        return formatPaginatedTsvResponse(trimmedTasks, paginationInfo);
      },
    });
  • Zod schema defining the input parameters for the tool: optional offset (>=0) and limit (1-1000).
    export const getArchivedTasksSchema = z.object({
      offset: z.number().int().min(0).optional().describe(
        "Pagination offset (defaults to 0)",
      ),
      limit: z.number().int().min(1).max(1000).optional().describe(
        "Maximum number of tasks to return (defaults to 100)",
      ),
    });
  • Registers the getArchivedTasksTool as part of the taskTools array export.
    export const taskTools = [
      // Query tools
      getTasksBacklogTool,
      getTasksByDayTool,
      getArchivedTasksTool,
      getTaskByIdTool,
    
      // Lifecycle tools
      createTaskTool,
      deleteTaskTool,
    
      // Update tools
      updateTaskCompleteTool,
      updateTaskSnoozeDateTool,
      updateTaskBacklogTool,
      updateTaskPlannedTimeTool,
      updateTaskNotesTool,
      updateTaskDueDateTool,
      updateTaskTextTool,
      updateTaskStreamTool,
    ];
  • src/tools/index.ts:5-9 (registration)
    Final registration: spreads taskTools (including getArchivedTasksTool) into the allTools array, which is used for MCP server tool registration.
    export const allTools = [
      ...userTools,
      ...taskTools,
      ...streamTools,
    ];
  • Imports helper functions like withTransportClient (wraps the handler), formatPaginatedTsvResponse (used in execute for output), and ToolContext type.
    import {
      formatJsonResponse,
      formatPaginatedTsvResponse,
      formatTsvResponse,
      withTransportClient,
      type ToolContext,
    } from "./shared.js";
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions pagination but doesn't disclose behavioral traits such as authentication requirements, rate limits, whether archived tasks are read-only, or what the return format looks like. For a tool with no annotation coverage, 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 that front-loads the core purpose ('Get archived tasks') and adds a useful detail ('with optional pagination'). There is no wasted verbiage, making it appropriately concise.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what archived tasks are, how they differ from other task types, what data is returned, or any error conditions. For a tool with 2 parameters and multiple siblings, more context is needed to guide effective use.

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 both parameters (limit and offset). The description adds minimal value beyond the schema by implying pagination is optional, but doesn't provide additional context like typical use cases or constraints beyond what's in the schema descriptions.

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 verb ('Get') and resource ('archived tasks'), making the purpose immediately understandable. It distinguishes from siblings like 'get-tasks-backlog' or 'get-tasks-by-day' by specifying archived tasks, though it doesn't explicitly contrast them.

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 'get-tasks-backlog' or 'get-task-by-id'. It mentions optional pagination but doesn't explain when pagination is needed or any prerequisites for accessing archived tasks.

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/robertn702/mcp-sunsama'

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