Skip to main content
Glama

taxonomy_upsert_term

Add or update taxonomy rules for organizing academic literature by defining classification patterns, priorities, and categories.

Instructions

添加或更新词表规则

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYes
familyYes
patternYes
priorityNo
enabledNo
notesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'taxonomy_upsert_term' tool. It adds or updates a taxonomy term in the 'taxonomy_terms' table using PostgreSQL INSERT with ON CONFLICT DO NOTHING.
    @mcp.tool()
    def taxonomy_upsert_term(
        kind: str,
        family: str,
        pattern: str,
        priority: int = 100,
        enabled: bool = True,
        notes: str | None = None,
    ) -> dict[str, Any]:
        """添加或更新词表规则"""
        try:
            with get_db() as conn:
                with conn.cursor() as cur:
                    cur.execute("""
                        INSERT INTO taxonomy_terms (kind, family, pattern, priority, enabled, notes)
                        VALUES (%s, %s, %s, %s, %s, %s)
                        ON CONFLICT DO NOTHING
                        RETURNING term_id
                    """, (kind, family, pattern, priority, enabled, notes))
                    result = cur.fetchone()
                    term_id = result["term_id"] if result else None
            return {"term_id": term_id, "created": term_id is not None}
        except Exception as e:
            return {"error": str(e)}
  • Registers the graph_v12 tools, including 'taxonomy_upsert_term', by calling the register_graph_v12_tools function.
    register_graph_v12_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('add or update') but doesn't cover critical traits: whether this is a mutation (likely yes, but not confirmed), what permissions are needed, if changes are reversible, rate limits, or error handling. For a tool with 6 parameters and no annotations, this is a significant gap in transparency.

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, efficient sentence in Chinese ('添加或更新词表规则') that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste—every word earns its place.

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 tool's complexity (6 parameters, mutation implied, no annotations) and the presence of an output schema (which might cover return values), the description is incomplete. It lacks usage guidelines, parameter explanations, and behavioral context, making it inadequate for safe and effective tool invocation despite the output schema potentially helping with returns.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter details. The description adds no semantic information about the 6 parameters (kind, family, pattern, priority, enabled, notes)—it doesn't explain what they mean, their formats, or how they interact. This fails to compensate for the lack of schema documentation, leaving parameters largely unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '添加或更新词表规则' (Add or update taxonomy rules) clearly states the verb-action ('add or update') and resource ('taxonomy rules'), providing a basic purpose. However, it doesn't distinguish this tool from potential siblings like 'taxonomy_list_terms'—it's vague about what 'rules' specifically entail versus 'terms' in the sibling tool, missing sibling differentiation.

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 offers no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, conditions for 'add' vs 'update', or comparison to sibling tools like 'taxonomy_list_terms'. It lacks explicit or implied usage context, leaving the agent with no direction.

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/h-lu/paperlib-mcp'

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