Skip to main content
Glama
jmjeong

Whooing MCP

by jmjeong

whooing_latest_items

Read-only

Retrieve unique transaction items from the past 60 days to populate autocomplete suggestions when adding new entries.

Instructions

Get recent unique transaction items from the past 60 days. Useful for autocomplete suggestions when adding new entries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
section_idNoSection ID. Defaults to WHOOING_SECTION_ID env var.

Implementation Reference

  • The handler function for whooing_latest_items. Calls loadAccounts, then fetches entries/latest_items.json, formats results via formatLatestItems.
    async (args) => {
      const sectionId = args.section_id ?? client.defaultSectionId;
      await client.loadAccounts(sectionId);
    
      const results = await client.apiGet("entries/latest_items.json", {
        section_id: sectionId,
      });
    
      const text = formatLatestItems(
        results as Parameters<typeof formatLatestItems>[0],
        client.getAccountCache()
      );
      return { content: [{ type: "text", text }] };
    }
  • Registration of the whooing_latest_items tool with description, inputSchema (optional section_id), and readOnlyHint annotation.
    server.registerTool(
      "whooing_latest_items",
      {
        description:
          "Get recent unique transaction items from the past 60 days. " +
          "Useful for autocomplete suggestions when adding new entries.",
        inputSchema: {
          section_id: z
            .string()
            .optional()
            .describe("Section ID. Defaults to WHOOING_SECTION_ID env var."),
        },
        annotations: { readOnlyHint: true },
      },
      async (args) => {
        const sectionId = args.section_id ?? client.defaultSectionId;
        await client.loadAccounts(sectionId);
    
        const results = await client.apiGet("entries/latest_items.json", {
          section_id: sectionId,
        });
    
        const text = formatLatestItems(
          results as Parameters<typeof formatLatestItems>[0],
          client.getAccountCache()
        );
        return { content: [{ type: "text", text }] };
      }
    );
  • Input schema for whooing_latest_items: optional section_id string parameter.
    inputSchema: {
      section_id: z
        .string()
        .optional()
        .describe("Section ID. Defaults to WHOOING_SECTION_ID env var."),
    },
  • formatLatestItems function that formats the API results (array of LatestItem) into a human-readable markdown string with account names resolved from cache.
    export function formatLatestItems(
      results: LatestItem[],
      accounts: Map<string, AccountInfo>
    ): string {
      const lines: string[] = [];
      lines.push("## 최근 거래 항목 (자동완성용)");
      lines.push("");
    
      if (!Array.isArray(results) || results.length === 0) {
        lines.push("최근 60일간 거래 항목이 없습니다.");
        return lines.join("\n");
      }
    
      for (const item of results) {
        const lName = accounts.get(item.l_account_id)?.name ?? item.l_account_id;
        const rName = accounts.get(item.r_account_id)?.name ?? item.r_account_id;
        lines.push(
          `- **${item.item}** ${formatAmount(item.money)} [${lName} ← ${rName}]`
        );
      }
    
      return lines.join("\n");
    }
  • formatAmount helper used by formatLatestItems to format monetary amounts in Korean won (KRW) with locale formatting.
    function formatAmount(amount: number | string | null | undefined): string {
      const numeric = Number(amount ?? 0);
      if (!Number.isFinite(numeric)) {
        return `${amount ?? 0}원`;
      }
      return numeric.toLocaleString("ko-KR") + "원";
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true. Description adds that items are 'unique' and from 'past 60 days', but no further behavioral details (e.g., ordering, pagination). Fails to add significant value beyond annotations.

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, then use case. No extraneous information.

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

Completeness4/5

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

For a simple read-only tool with one optional parameter, the description adequately covers purpose and context. However, could mention output format or ordering for completeness.

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 description does not need to add parameter details. It adds no extra meaning beyond the schema.

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?

Clearly states the verb 'Get', resource 'recent unique transaction items', and time range 'past 60 days'. Distinguishes from sibling 'whooing_frequent_items' by emphasizing uniqueness and recency.

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

Usage Guidelines4/5

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

Explicitly mentions use case 'autocomplete suggestions when adding new entries', providing clear context for when to use. However, does not contrast with alternatives like 'whooing_entries' or 'whooing_frequent_items'.

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/jmjeong/whooing-mcp'

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