Skip to main content
Glama
Mistizz

Japanese Text Analyzer

count_clipboard_chars

Measure the character count of text excluding spaces and line breaks. Use this tool to analyze Japanese or English text for precise character counts, ensuring accurate text processing.

Instructions

テキストの文字数を計測します。スペースや改行を除いた実質的な文字数をカウントします。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes文字数をカウントするテキスト

Implementation Reference

  • The private method countTextCharsImpl that contains the core logic for counting characters in the provided text, excluding whitespace and newlines. This is invoked by the count_clipboard_chars tool handler.
    private countTextCharsImpl(text: string, sourceName: string = 'テキスト') {
      try {
        // 改行とスペースを除外した文字数
        const contentWithoutSpacesAndNewlines = text.replace(/[\s\n\r]/g, '');
        const effectiveCharCount = contentWithoutSpacesAndNewlines.length;
        
        return {
          content: [{ 
            type: 'text' as const, 
            text: `${sourceName}の文字数: ${effectiveCharCount}文字(改行・スペース除外)`
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: 'text' as const, 
            text: `エラーが発生しました: ${error.message}`
          }],
          isError: true
        };
      }
    }
  • src/index.ts:521-527 (registration)
    Registration of the 'count_clipboard_chars' tool using this.server.tool(), including the inline schema with zod and the handler function that delegates to countTextCharsImpl.
    this.server.tool(
      'count_clipboard_chars', 
      'テキストの文字数を計測します。スペースや改行を除いた実質的な文字数をカウントします。',
      { text: z.string().describe('文字数をカウントするテキスト') },
      async ({ text }) => this.countTextCharsImpl(text)
    );
Behavior3/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 adds useful behavioral context by specifying that it counts '実質的な文字数' (substantial characters) excluding spaces and line breaks, which clarifies the counting method. However, it doesn't disclose other traits like error handling, performance, or output format.

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 extremely concise and front-loaded, consisting of just two sentences that directly state the tool's purpose and counting method. Every sentence earns its place by providing essential information without 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 tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It explains what the tool does and the counting method, but lacks details on output format, error cases, or differentiation from siblings. For a simple tool, this is acceptable but leaves gaps.

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?

The schema description coverage is 100%, with the parameter 'text' clearly documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides, such as examples or constraints. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose: 'テキストの文字数を計測します' (counts characters in text). It specifies the verb (計測/measure) and resource (テキスト/text). However, it doesn't explicitly distinguish itself from sibling tools like 'count_chars' or 'count_clipboard_words', which likely have similar functions.

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. It doesn't mention sibling tools like 'count_chars' or 'count_clipboard_words', nor does it specify contexts or exclusions for its use. The agent must infer usage from the tool name and description alone.

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

Related 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/Mistizz/mcp-JapaneseTextAnalyzer'

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