Skip to main content
Glama

resolve_period

Resolve a group of duty days into per-day attendance records and optionally a period summary with attendance rate and flags.

Instructions

Resolve a sequence of duty days (a week, a pay period, a month). Returns per-day DayResult entries; optionally include an aggregated PeriodSummary with attendance rate and flag counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysYesInputs for each duty day in the period.
summaryNoInclude the aggregated PeriodSummary. Default: true.

Implementation Reference

  • The registerResolvePeriod function registers the 'resolve_period' tool with the MCP server. The handler calls resolveRange(days) from @attendance-engine/core to process each day, then optionally calls summarize() to include an aggregated PeriodSummary. Returns the payload as JSON text via the jsonText helper.
    export function registerResolvePeriod(server: McpServer): void {
      server.tool(
        'resolve_period',
        "Resolve a sequence of duty days (a week, a pay period, a month). Returns per-day DayResult entries; optionally include an aggregated PeriodSummary with attendance rate and flag counts.",
        {
          days: z.array(ResolveDayInputSchema).describe('Inputs for each duty day in the period.'),
          summary: z.boolean().optional().describe('Include the aggregated PeriodSummary. Default: true.'),
        },
        async ({ days, summary }) => {
          const results = resolveRange(days);
          const payload = summary === false
            ? { days: results }
            : { days: results, summary: summarize(results) };
          return { content: [jsonText(payload)] };
        },
      );
    }
  • ResolveDayInputSchema defines the input schema for each day in the period: date, punches, shift, policy, leave, holiday, weekend. This is used as the array element type for the 'days' parameter of resolve_period.
    export const ResolveDayInputSchema = z.object({
      date: z
        .string()
        .regex(/^\d{4}-\d{2}-\d{2}$/)
        .describe('Duty date in worksite local wall-clock, YYYY-MM-DD.'),
      punches: z.array(PunchSchema),
      shift: ShiftConfigSchema,
      policy: AttendancePolicySchema.optional(),
      leave: LeaveDaySchema.nullable().optional(),
      holiday: z.boolean().optional(),
      weekend: z.boolean().optional(),
    });
  • src/server.ts:36-37 (registration)
    The tool is registered via registerResolvePeriod(server) call in the createServer function, after the import on line 11.
    registerResolveDay(server);
    registerResolvePeriod(server);
  • The jsonText helper serializes a value as pretty-printed JSON and wraps it as an MCP text-content block, used by the resolve_period handler to return its response.
    export function jsonText(value: unknown): { type: 'text'; text: string } {
      return { type: 'text', text: JSON.stringify(value, null, 2) };
    }
Behavior3/5

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

The description discloses that the tool returns per-day DayResult entries and optionally a PeriodSummary with attendance rate and flag counts, which gives basic behavioral insight. However, no annotations exist, so the description carries the full burden, and it does not mention side effects, authentication requirements, or error handling.

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?

Two sentences, front-loaded with purpose and output structure. Every sentence adds essential information. No redundancy or fluff.

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

Completeness3/5

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

Given the complexity of the tool (nested input schema for days) and absence of output schema, the description adequately covers purpose and output but lacks context on return value details, edge cases, or practical constraints. It is minimally complete.

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?

Parameter descriptions in the schema already cover 100% of parameters. The description adds minimal value beyond the schema, only reiterating the optional nature of the summary parameter. Therefore, rating is baseline 3.

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

Purpose5/5

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

The description clearly states that the tool resolves a sequence of duty days, specifying possible timeframes (week, pay period, month) and output structure (per-day entries, optional aggregated summary). This specificity distinguishes it from siblings like resolve_day and audit_period_compliance.

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 use for a period of multiple days versus resolve_day for a single day, but it lacks explicit guidance on when to use this tool versus alternatives or any prerequisites. No 'when not to use' information 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/arifur9993/attendance-engine-mcp'

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