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

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)

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