Skip to main content
Glama
Ukenn2112

Bangumi TV MCP Service

by Ukenn2112

get_person_subjects

Retrieve a list of subjects (e.g., anime, games) associated with a specific person by providing their unique ID, enabling insights into their contributions or roles.

Instructions

List subjects (e.g., anime, games) a person is related to (e.g., worked on).

Args:
    person_id: The ID of the person.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
person_idYes

Implementation Reference

  • The handler function for the get_person_subjects tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function makes an API request to Bangumi's /v0/persons/{person_id}/subjects endpoint, handles errors, parses the response (a list of subjects), formats each subject's info (ID, name, type using SubjectType enum, and staff role), and returns a formatted string summary.
    @mcp.tool()
    async def get_person_subjects(person_id: int) -> str:
        """
        List subjects (e.g., anime, games) a person is related to (e.g., worked on).
    
        Args:
            person_id: The ID of the person.
    
        Returns:
            Formatted list of related subjects or an error message.
        """
        response = await make_bangumi_request(
            method="GET", path=f"/v0/persons/{person_id}/subjects"
        )
    
        error_msg = handle_api_error_response(response)
        if error_msg:
            return error_msg
    
        # Expecting a list of related subjects
        if not isinstance(response, list):
            return f"Unexpected API response format for get_person_subjects: {response}"
    
        related_subjects = response
        if not related_subjects:
            return f"No subjects found related to person ID {person_id}."
    
        formatted_results = []
        for rel_subject in related_subjects:
            name = rel_subject.get("name")
            name_cn = rel_subject.get("name_cn")
            rel_id = rel_subject.get("id")
            rel_type_int = rel_subject.get("type")
            try:
                rel_type_str = (
                    SubjectType(rel_type_int).name
                    if rel_type_int is not None
                    else "Unknown Type"
                )
            except ValueError:
                rel_type_str = f"Unknown Type ({rel_type_int})"
    
            staff_info = rel_subject.get(
                "staff"
            )  # Role of the person in the subject e.g. "导演"
    
            formatted_results.append(
                f"Subject ID: {rel_id}, Name: {name_cn or name}, Type: {rel_type_str}, Role/Staff: {staff_info}"
            )
    
        return "Subjects This Person is Related To:\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 states the tool lists subjects and returns a formatted list or error, but lacks details on permissions, rate limits, pagination, or what 'formatted' entails. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 efficiently structured with a clear purpose statement followed by 'Args' and 'Returns' sections. Every sentence earns its place by providing essential information without redundancy. It is front-loaded with the core functionality and appropriately sized for a simple tool.

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 adequate but not complete. It covers the basic purpose and parameter semantics but lacks behavioral details (e.g., error conditions, output format specifics). Without annotations or output schema, more context on what 'formatted list' means would improve completeness.

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?

The description adds meaningful context for the single parameter 'person_id' by explaining it's 'The ID of the person,' which clarifies its role beyond the schema's basic type (integer). With 0% schema description coverage, this compensates well, though it could specify format constraints (e.g., numeric range). Since there's only one parameter, the baseline is high.

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 subjects (e.g., anime, games) a person is related to (e.g., worked on).' It specifies the verb ('List'), resource ('subjects'), and scope ('a person is related to'), with helpful examples. However, it does not explicitly differentiate from sibling tools like 'get_person_characters' or 'get_person_details', which reduces it from 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. It does not mention sibling tools (e.g., 'get_person_characters' for characters instead of subjects) or contexts where other tools might be more appropriate. Usage is implied by the purpose but lacks explicit when/when-not instructions.

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