Skip to main content
Glama
Ukenn2112

Bangumi TV MCP Service

by Ukenn2112

get_character_persons

Retrieve a formatted list of persons, such as voice actors, associated with a specific character using the character ID through Bangumi TV MCP Service.

Instructions

List persons (e.g., voice actors) related to a character.

Args:
    character_id: The ID of the character.

Returns:
    Formatted list of related persons or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
character_idYes

Implementation Reference

  • The primary handler for the 'get_character_persons' tool. Decorated with @mcp.tool(), it defines the schema from the signature and docstring, registers the tool, and implements the logic: calls Bangumi API /v0/characters/{character_id}/persons, handles errors, parses response, formats persons with type and role using PersonType enum.
    @mcp.tool()
    async def get_character_persons(character_id: int) -> str:
        """
        List persons (e.g., voice actors) related to a character.
    
        Args:
            character_id: The ID of the character.
    
        Returns:
            Formatted list of related persons or an error message.
        """
        response = await make_bangumi_request(
            method="GET", path=f"/v0/characters/{character_id}/persons"
        )
    
        error_msg = handle_api_error_response(response)
        if error_msg:
            return error_msg
    
        # Expecting a list of persons
        if not isinstance(response, list):
            return f"Unexpected API response format for get_character_persons: {response}"
    
        persons = response
        if not persons:
            return f"No persons found related to character ID {character_id}."
    
        formatted_results = []
        for person in persons:
            name = person.get("name")
            person_id = person.get("id")
            person_type_int = person.get("type")
            try:
                person_type_str = (
                    PersonType(person_type_int).name
                    if person_type_int is not None
                    else "Unknown Type"
                )
            except ValueError:
                person_type_str = f"Unknown Type ({person_type_int})"
    
            staff_info = person.get("staff")  # Role of the person for this character (e.g.,
    
            formatted_results.append(
                f"Person ID: {person_id}, Name: {name}, Type: {person_type_str}, Role (for character): {staff_info}"
            )
    
        return "Persons Related to This Character:\n" + "\n---\n".join(formatted_results)
  • A helper prompt that instructs the LLM to use the 'get_character_persons' tool after searching for a character, specifically to find voice actors.
    @mcp.prompt()
    def find_voice_actor(character_name: str) -> str:
        """
        Search for a character by name and find their voice actor.
    
        Args:
            character_name: The name of the character.
        """
        return f"Search for the character '{character_name}' using 'search_characters'. If the search finds characters, identify the most relevant character ID. Then, use 'get_character_persons' with the character ID to list persons related to them (like voice actors). Summarize the voice actors found from the tool output."
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool lists persons and returns formatted data or errors, but lacks details on pagination, rate limits, authentication needs, or what 'formatted list' entails (e.g., structure, fields). This is a significant gap for a read operation with no annotation coverage.

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 front-loaded with the core purpose, followed by structured Args and Returns sections. Every sentence earns its place by clarifying inputs and outputs without redundancy, making it highly efficient and well-organized.

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 no annotations, no output schema, and low schema coverage, the description is minimally adequate. It covers the purpose and parameter semantics but lacks behavioral details (e.g., error conditions, data format) and usage guidelines relative to siblings, leaving gaps for an AI agent to infer correctly.

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

Parameters4/5

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

Schema description coverage is 0%, but the description compensates by explaining the single parameter 'character_id' as 'The ID of the character', adding meaning beyond the schema's type annotation. With only one parameter clearly documented, this is sufficient for baseline understanding.

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 verb ('List') and resource ('persons related to a character'), with examples ('voice actors') adding specificity. It distinguishes from siblings like 'get_person_characters' (reverse relationship) and 'get_character_details' (different data), though not explicitly named.

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?

No explicit guidance on when to use this tool versus alternatives like 'get_person_characters' (which lists characters for a person) or 'get_subject_persons' (which may have overlapping functionality). The description implies usage when you have a character ID and want related persons, but lacks comparative context.

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/Ukenn2112/BangumiMCP'

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