Skip to main content
Glama
vivek081166

japan-utils-mcp

split_japanese_name

Split Japanese full names into surname and given name using a kanji-based statistical model. Returns confidence score and algorithm info.

Instructions

Split a Japanese full name into surname (姓) and given name (名).

Uses a kanji-feature-based statistical model (namedivider-python).

Args: full_name: Japanese full name written in kanji, with no separator (e.g. '山田太郎', '長谷川健太'). Names with existing separators (space, comma) are also accepted — the separator will be re-detected.

Returns: dict with keys: - input: str - family: str (姓 — surname) - given: str (名 — given name) - confidence: float (0.0–1.0; higher = more confident split) - algorithm: str (which underlying algorithm produced the split)

Examples: split_japanese_name("山田太郎") → {"family": "山田", "given": "太郎", ...} split_japanese_name("長谷川健太") → {"family": "長谷川", "given": "健太", ...} split_japanese_name("佐藤花子") → {"family": "佐藤", "given": "花子", ...}

Caveats: - Statistical model — not 100% accurate, especially for unusual names or non-traditional name compositions. - Confidence < 0.5 indicates an ambiguous split; treat with caution. - Single-kanji surnames + single-kanji given names (e.g. '林修') are fundamentally ambiguous without external context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
full_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The @mcp.tool() decorated function that implements the split_japanese_name tool. It cleans the input, uses a BasicNameDivider (from namedivider-python) to perform the split, and returns a dict with input, family, given, confidence, and algorithm keys.
    @mcp.tool()
    def split_japanese_name(full_name: str) -> dict[str, Any]:
        """Split a Japanese full name into surname (姓) and given name (名).
    
        Uses a kanji-feature-based statistical model (`namedivider-python`).
    
        Args:
            full_name: Japanese full name written in kanji, with no separator
                (e.g. '山田太郎', '長谷川健太'). Names with existing separators
                (space, comma) are also accepted — the separator will be re-detected.
    
        Returns:
            dict with keys:
                - input: str
                - family: str (姓 — surname)
                - given: str (名 — given name)
                - confidence: float (0.0–1.0; higher = more confident split)
                - algorithm: str (which underlying algorithm produced the split)
    
        Examples:
            split_japanese_name("山田太郎") → {"family": "山田", "given": "太郎", ...}
            split_japanese_name("長谷川健太") → {"family": "長谷川", "given": "健太", ...}
            split_japanese_name("佐藤花子") → {"family": "佐藤", "given": "花子", ...}
    
        Caveats:
            - Statistical model — not 100% accurate, especially for unusual names
              or non-traditional name compositions.
            - Confidence < 0.5 indicates an ambiguous split; treat with caution.
            - Single-kanji surnames + single-kanji given names (e.g. '林修') are
              fundamentally ambiguous without external context.
        """
        cleaned = full_name.strip().replace(" ", "").replace(" ", "").replace(",", "")
        if not cleaned:
            raise ValueError("full_name cannot be empty.")
    
        divider = _get_name_divider()
        result = divider.divide_name(cleaned)
        return {
            "input": full_name,
            "family": result.family,
            "given": result.given,
            "confidence": float(result.score),
            "algorithm": result.algorithm,
        }
  • Helper area: module-level _name_divider variable and lazy-initialization function _get_name_divider() that creates a BasicNameDivider instance.
    # ──────────────────────────────────────────────────────────────────────
    # Name splitting
    # ──────────────────────────────────────────────────────────────────────
    
    _name_divider: BasicNameDivider | None = None
    
    
    def _get_name_divider() -> BasicNameDivider:
        global _name_divider
        if _name_divider is None:
            _name_divider = BasicNameDivider()
        return _name_divider
  • Tool registration at module level: the tool description listed in the module docstring and the @mcp.tool() decorator on line 502 registers it with the FastMCP server.
    - split_japanese_name: split a Japanese full name into surname + given name
  • Full function signature and docstring defining the schema: accepts a string full_name, returns a dict with input, family, given, confidence (0.0-1.0), and algorithm.
    def split_japanese_name(full_name: str) -> dict[str, Any]:
        """Split a Japanese full name into surname (姓) and given name (名).
    
        Uses a kanji-feature-based statistical model (`namedivider-python`).
    
        Args:
            full_name: Japanese full name written in kanji, with no separator
                (e.g. '山田太郎', '長谷川健太'). Names with existing separators
                (space, comma) are also accepted — the separator will be re-detected.
    
        Returns:
            dict with keys:
                - input: str
                - family: str (姓 — surname)
                - given: str (名 — given name)
                - confidence: float (0.0–1.0; higher = more confident split)
                - algorithm: str (which underlying algorithm produced the split)
    
        Examples:
            split_japanese_name("山田太郎") → {"family": "山田", "given": "太郎", ...}
            split_japanese_name("長谷川健太") → {"family": "長谷川", "given": "健太", ...}
            split_japanese_name("佐藤花子") → {"family": "佐藤", "given": "花子", ...}
    
        Caveats:
            - Statistical model — not 100% accurate, especially for unusual names
              or non-traditional name compositions.
            - Confidence < 0.5 indicates an ambiguous split; treat with caution.
            - Single-kanji surnames + single-kanji given names (e.g. '林修') are
              fundamentally ambiguous without external context.
Behavior5/5

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

Without annotations, the description fully discloses behavioral traits: it is a statistical model with potential inaccuracies, confidence scores are provided, and ambiguity for certain name structures is noted. It also mentions that names with separators are accepted and re-detected.

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 well-structured with sections (brief intro, Args, Returns, Examples, Caveats), front-loaded with the core purpose, and every sentence adds value. No extraneous information.

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

Completeness5/5

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

Given the tool's simplicity (single parameter, output schema exists), the description is complete. It covers input format, output structure with keys, confidence interpretation, and common pitfalls. No significant gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has only one parameter with 0% description coverage, so the description must add meaning. It does so by explicitly describing the expected format (kanji without separator, but also accepts separators) and providing multiple examples. This fully compensates for the lack of schema description.

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 tool splits a Japanese full name into surname and given name, specifying the underlying model. It is distinct from sibling tools which handle other Japanese text operations like kana conversion or romanization.

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?

The description provides clear guidance on when to use the tool (for Japanese full names in kanji, with or without separators) and includes caveats about accuracy and ambiguous names. It does not explicitly state when not to use it or suggest alternatives, but the context is sufficient.

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/vivek081166/japan-utils-mcp'

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