Skip to main content
Glama

get_comments

Retrieve comments for a specific Gelbooru post by providing the post ID to access user discussions and feedback.

Instructions

Retrieve comments for a specific Gelbooru post.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYesThe post ID whose comments you want to retrieve.

Implementation Reference

  • The handler function for get_comments tool. It constructs API parameters (page='dapi', s='comment', q='index', post_id from arguments) and calls the _get helper function to fetch comments from Gelbooru API.
    elif name == "get_comments":
        params = {"page": "dapi", "s": "comment", "q": "index", "post_id": arguments["post_id"]}
        result = await loop.run_in_executor(None, _get, params)
  • Tool registration for get_comments. Defines the tool schema with a required post_id parameter (integer) describing which post's comments to retrieve.
    Tool(
        name="get_comments",
        description="Retrieve comments for a specific Gelbooru post.",
        inputSchema={
            "type": "object",
            "properties": {
                "post_id": {
                    "type": "integer",
                    "description": "The post ID whose comments you want to retrieve.",
                },
            },
            "required": ["post_id"],
        },
    ),
  • The _get helper function that performs synchronous HTTP GET requests to the Gelbooru API, handles authentication via environment variables, and returns parsed JSON responses.
    def _get(params: dict) -> Any:
        """Perform a synchronous HTTP GET and return parsed JSON."""
        params = {**params, "json": "1"}   # copy — never mutate the caller's dict
        _build_auth(params)
        url = f"{BASE_URL}?{urlencode(params)}"
        req = Request(url, headers={"User-Agent": "GelbooruMCP/1.0"})
        try:
            with urlopen(req, timeout=15) as resp:
                raw = resp.read().decode("utf-8")
        except URLError as exc:
            return {"error": str(exc)}
        try:
            return json.loads(raw)
        except json.JSONDecodeError:
            # Some endpoints return XML/empty on error; surface the raw text
            return {"raw": raw}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Retrieve') but does not clarify if this is a read-only operation, requires authentication, has rate limits, or describes the return format (e.g., list structure, pagination). This leaves significant gaps for a tool that fetches data.

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 a single, direct sentence with zero wasted words, efficiently stating the tool's purpose. It is appropriately sized and front-loaded, making it easy to parse without unnecessary elaboration.

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 lack of annotations and output schema, the description is incomplete for a data retrieval tool. It does not explain what the return values look like (e.g., comment format, error handling) or address behavioral aspects like permissions or limitations, leaving the agent with insufficient context for effective 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 input schema has 100% description coverage, with the 'post_id' parameter clearly documented. The description adds no additional semantic details beyond what the schema provides, such as example values or constraints, so it meets the baseline for high schema coverage without compensating further.

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 ('Retrieve') and resource ('comments for a specific Gelbooru post'), making the purpose unambiguous. However, it does not differentiate from sibling tools like 'search_posts' or 'get_deleted_posts' in terms of scope or functionality, 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, such as whether it's for fetching all comments on a post versus filtered searches. It lacks any mention of prerequisites, exclusions, or sibling tool comparisons, leaving usage context implied at best.

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/citronlegacy/gelbooru-mcp'

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