Skip to main content
Glama
jmjeong

Whooing MCP

by jmjeong

whooing_balance

Read-only

Retrieve balance sheet (assets, liabilities, capital) for any date range to understand your financial position.

Instructions

Get balance sheet (assets, liabilities, capital) as of a date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNoStart date (YYYYMMDD). Defaults to 1st of current month.
end_dateNoEnd date (YYYYMMDD). Defaults to today.
section_idNoSection ID. Defaults to WHOOING_SECTION_ID env var.

Implementation Reference

  • The handler function for 'whooing_balance' tool. It normalizes date args, fetches a balance sheet (bs.json) from the Whooing API, formats the result via formatBalance(), and returns text content.
    async (args) => {
      const defaults = getDateDefaults();
      const startDate = normalizeDate(args.start_date ?? defaults.startDate);
      const endDate = normalizeDate(args.end_date ?? defaults.endDate);
      const sectionId = args.section_id ?? client.defaultSectionId;
    
      await client.loadAccounts(sectionId);
      const results = await client.apiGet("bs.json", {
        section_id: sectionId,
        start_date: startDate,
        end_date: endDate,
      });
    
      const text = formatBalance(
        results as Parameters<typeof formatBalance>[0],
        client.getAccountCache(),
        startDate,
        endDate
      );
      return { content: [{ type: "text", text }] };
    }
  • The input schema (dateRangeSchema) used by the whooing_balance tool. Defines optional start_date, end_date, and section_id fields.
    const dateRangeSchema = {
      start_date: z
        .string()
        .regex(/^\d{4}-?\d{2}-?\d{2}$/)
        .optional()
        .describe("Start date (YYYYMMDD). Defaults to 1st of current month."),
      end_date: z
        .string()
        .regex(/^\d{4}-?\d{2}-?\d{2}$/)
        .optional()
        .describe("End date (YYYYMMDD). Defaults to today."),
      section_id: z
        .string()
        .optional()
        .describe("Section ID. Defaults to WHOOING_SECTION_ID env var."),
    };
  • src/server.ts:826-855 (registration)
    Registration of the 'whooing_balance' tool via server.registerTool() with description, inputSchema, and annotations.
    server.registerTool(
      "whooing_balance",
      {
        description:
          "Get balance sheet (assets, liabilities, capital) as of a date range",
        inputSchema: dateRangeSchema,
        annotations: { readOnlyHint: true },
      },
      async (args) => {
        const defaults = getDateDefaults();
        const startDate = normalizeDate(args.start_date ?? defaults.startDate);
        const endDate = normalizeDate(args.end_date ?? defaults.endDate);
        const sectionId = args.section_id ?? client.defaultSectionId;
    
        await client.loadAccounts(sectionId);
        const results = await client.apiGet("bs.json", {
          section_id: sectionId,
          start_date: startDate,
          end_date: endDate,
        });
    
        const text = formatBalance(
          results as Parameters<typeof formatBalance>[0],
          client.getAccountCache(),
          startDate,
          endDate
        );
        return { content: [{ type: "text", text }] };
      }
    );
  • BSResults interface defining the shape of the balance sheet response (assets, liabilities, capital as CategoryGroup).
    interface BSResults {
      assets?: CategoryGroup;
      liabilities?: CategoryGroup;
      capital?: CategoryGroup;
    }
  • The formatBalance() helper function that formats balance sheet data into a human-readable string with asset/liability/capital sections.
    export function formatBalance(
      results: BSResults,
      accounts: Map<string, AccountInfo>,
      startDate: string,
      endDate: string
    ): string {
      const lines: string[] = [];
      lines.push(`## 자산/부채 현황 (${startDate} ~ ${endDate})`);
      lines.push("");
    
      const sections: [string, CategoryGroup | undefined][] = [
        ["자산", results.assets],
        ["부채", results.liabilities],
        ["자본", results.capital],
      ];
    
      for (const [title, group] of sections) {
        const filtered = normalizeAccountEntries(group?.accounts)
          .filter((item) => Number(item.money) !== 0)
          .sort((a, b) => Math.abs(Number(b.money)) - Math.abs(Number(a.money)));
    
        if (filtered.length > 0) {
          lines.push(`### ${title}: ${formatAmount(group?.total ?? 0)}`);
          for (const item of filtered) {
            const name = accounts.get(item.account_id)?.name ?? item.account_id;
            lines.push(`- ${name}: ${formatAmount(item.money)}`);
          }
          lines.push("");
        }
      }
    
      return lines.join("\n");
    }
Behavior3/5

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

Annotations already provide readOnlyHint=true. The description adds minimal behavioral context beyond confirming it is a read operation. No additional behaviors like pagination or aggregation are disclosed.

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 sentence of 9 words, front-loaded with action, and contains no unnecessary information. Every word serves a purpose.

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?

Given the low complexity (no required params, no output schema), the description is mostly adequate. It explains the core function but could optionally mention that section_id is optional and defaults to an environment variable, which is already in the schema.

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 coverage is 100%, so baseline is 3. The description mentions 'as of a date range', which aligns with start_date and end_date, but does not add new 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?

The description clearly states the verb 'Get' and resource 'balance sheet', and specifies it includes assets, liabilities, and capital. This distinguishes it from siblings like whooing_pl (profit/loss) and whooing_accounts.

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 balance sheet queries but does not explicitly provide when-to-use or when-not-to-use guidance compared to alternatives. The context is clear but lacks explicit exclusions.

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