Skip to main content
Glama
robertn702

Sunsama MCP Server

get-tasks-by-day

Retrieve tasks scheduled for a specific date from Sunsama, with options to filter by completion status to focus on pending or finished work.

Instructions

Get tasks for a specific day with optional filtering by completion status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
completionFilterNoFilter tasks by completion status. 'all' returns all tasks, 'incomplete' returns only incomplete tasks, 'completed' returns only completed tasks. Defaults to 'all'
dayYes
timezoneNoTimezone string (e.g., 'America/New_York'). If not provided, uses user's default timezone

Implementation Reference

  • The primary handler for the 'get-tasks-by-day' tool. Fetches tasks for a given day (resolving timezone if needed), applies completion filtering, trims response data, and formats as TSV.
    export const getTasksByDayTool = withTransportClient({
      name: "get-tasks-by-day",
      description:
        "Get tasks for a specific day with optional filtering by completion status",
      parameters: getTasksByDaySchema,
      execute: async (
        { day, timezone, completionFilter = "all" }: GetTasksByDayInput,
        context: ToolContext,
      ) => {
        // If no timezone provided, get the user's default timezone
        let resolvedTimezone = timezone;
        if (!resolvedTimezone) {
          resolvedTimezone = await context.client.getUserTimezone();
        }
    
        const tasks = await context.client.getTasksByDay(day, resolvedTimezone);
        const filteredTasks = filterTasksByCompletion(tasks, completionFilter);
        const trimmedTasks = trimTasksForResponse(filteredTasks);
    
        return formatTsvResponse(trimmedTasks);
      },
    });
  • Zod input schema validating parameters for get-tasks-by-day: required 'day' (YYYY-MM-DD), optional 'timezone', optional 'completionFilter'.
    export const getTasksByDaySchema = z.object({
      day: z.string().regex(
        /^\d{4}-\d{2}-\d{2}$/,
        "Day must be in YYYY-MM-DD format",
      ),
      timezone: z.string().optional().describe(
        "Timezone string (e.g., 'America/New_York'). If not provided, uses user's default timezone",
      ),
      completionFilter: completionFilterSchema.optional().describe(
        "Filter tasks by completion status. 'all' returns all tasks, 'incomplete' returns only incomplete tasks, 'completed' returns only completed tasks. Defaults to 'all'",
      ),
    });
  • src/main.ts:33-44 (registration)
    Final MCP server registration of all tools (including get-tasks-by-day) by iterating allTools and calling server.registerTool with name, schema, and execute function.
    allTools.forEach((tool) => {
      server.registerTool(
        tool.name,
        {
          description: tool.description,
          inputSchema: "shape" in tool.parameters
            ? tool.parameters.shape
            : tool.parameters,
        },
        tool.execute,
      );
    });
  • Local registration of getTasksByDayTool within the taskTools array, which is later spread into allTools.
    export const taskTools = [
      // Query tools
      getTasksBacklogTool,
      getTasksByDayTool,
  • Helper function used in the handler to filter fetched tasks by completion status (all, incomplete, completed).
    export function filterTasksByCompletion(tasks: Task[], filter: CompletionFilter): Task[] {
      // Validate filter parameter
      if (!["all", "incomplete", "completed"].includes(filter)) {
        throw new Error(`Invalid completion filter: ${filter}. Must be 'all', 'incomplete', or 'completed'.`);
      }
    
      switch (filter) {
        case "all":
          return tasks; // No filtering - return all tasks
    
        case "incomplete":
          return tasks.filter(task => !task.completed);
    
        case "completed":
          return tasks.filter(task => task.completed);
    
        default:
          // TypeScript exhaustiveness check - should never reach here
          throw new Error(`Unhandled completion filter: ${filter satisfies never}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not behavioral traits like permissions needed, rate limits, pagination, return format, or error handling. It mentions optional filtering but doesn't explain what happens when filters are applied.

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. Every word earns its place with no redundancy or unnecessary elaboration.

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?

For a read operation with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (list structure, fields), how day filtering works with timezone, or behavioral aspects like error cases or data freshness.

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 67% (2 of 3 parameters have descriptions). The description adds marginal value by mentioning 'optional filtering by completion status', which aligns with the completionFilter parameter's schema description. However, it doesn't explain the day parameter format or timezone implications beyond what's in the schema.

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 'tasks for a specific day' with optional filtering by completion status. It distinguishes from siblings like get-task-by-id (single task) and get-tasks-backlog (backlog tasks), but doesn't explicitly mention how it differs from get-archived-tasks or other task retrieval tools.

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 for retrieving tasks for a specific day, but doesn't explicitly state when to use this vs. alternatives like get-tasks-backlog or get-archived-tasks. No guidance on prerequisites, exclusions, or comparison with sibling tools is provided.

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