Skip to main content
Glama
Ukenn2112

Bangumi TV MCP Service

by Ukenn2112

get_subject_characters

Retrieve a formatted list of characters related to a specific subject by providing its subject ID. Optimized for accessing character data within the Bangumi TV MCP Service.

Instructions

List characters related to a subject.

Args:
    subject_id: The ID of the subject.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subject_idYes

Implementation Reference

  • main.py:652-701 (handler)
    The handler function decorated with @mcp.tool(), implementing the logic to retrieve and format characters related to a given subject ID from the Bangumi API.
    @mcp.tool()
    async def get_subject_characters(subject_id: int) -> str:
        """
        List characters related to a subject.
    
        Args:
            subject_id: The ID of the subject.
    
        Returns:
            Formatted list of related characters or an error message.
        """
        response = await make_bangumi_request(
            method="GET", path=f"/v0/subjects/{subject_id}/characters"
        )
    
        error_msg = handle_api_error_response(response)
        if error_msg:
            return error_msg
    
        # Expecting a list of characters
        if not isinstance(response, list):
            return f"Unexpected API response format for get_subject_characters: {response}"
    
        characters = response
        if not characters:
            return f"No characters found related to subject ID {subject_id}."
    
        formatted_results = []
        for character in characters:
            name = character.get("name")
            char_id = character.get("id")
            relation = character.get("relation")
            actors = ", ".join(
                [a.get("name") for a in character.get("actors", []) if a.get("name")] or []
            )
    
            # Safely get character type name
            char_type_int = character.get("type")
            char_type_str = "Unknown Type"
            if char_type_int is not None:
                try:
                    char_type_str = CharacterType(char_type_int).name
                except ValueError:
                    char_type_str = f"Unknown Type ({char_type_int})"
    
            formatted_results.append(
                f"Character ID: {char_id}, Name: {name}, Type: {char_type_str}, Relation (in subject): {relation}, Voice Actors: {actors}"
            )
    
        return "Related Characters:\n" + "\n---\n".join(formatted_results)
Behavior2/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 of behavioral disclosure. It mentions that the tool returns a 'Formatted list of related characters or an error message,' which gives some insight into output behavior. However, it lacks details on permissions, rate limits, pagination, or error conditions, which are critical 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, using clear sections for 'Args' and 'Returns.' It avoids unnecessary details and gets straight to the point. However, the 'Returns' section could be more specific about the format, slightly reducing efficiency.

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

Completeness2/5

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

Given the complexity of having no annotations, no output schema, and low schema description coverage, the description is incomplete. It covers basic purpose and parameters but misses behavioral traits, error handling, and differentiation from siblings. For a tool in this context, more detail is needed to ensure reliable agent use.

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 description adds minimal semantics beyond the input schema. It explains that 'subject_id' is 'The ID of the subject,' which clarifies the parameter's purpose but doesn't provide format examples, constraints, or context. With 0% schema description coverage, this partial compensation is adequate but not comprehensive, meeting the baseline for moderate schema coverage.

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: 'List characters related to a subject.' It specifies the verb ('List') and resource ('characters related to a subject'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_character_subjects' or 'get_subject_persons,' which prevents a perfect score.

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. With multiple sibling tools like 'get_subject_details,' 'get_subject_persons,' and 'search_characters,' there's no indication of context, prerequisites, or exclusions. This lack of guidance could lead to confusion in tool selection.

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