Skip to main content
Glama
james-livefront

Poetry MCP Server

get_all_nexuses

Retrieve all available themes, motifs, and forms from the poetry registry to discover tagging options for poems. Returns organized categories for thematic classification.

Instructions

Get all nexuses (themes/motifs/forms) from the registry.

Returns complete registry with all nexus entries, organized by category. Use this to discover available themes, motifs, and forms for tagging poems.

Returns: NexusRegistry with themes, motifs, and forms

Example: Get all available themes: registry = await get_all_nexuses() for theme in registry.themes: print(f"{theme.name} → #{theme.canonical_tag}")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
formsNoForm nexuses (structural patterns)
motifsNoMotif nexuses (compositional patterns)
themesNoThematic nexuses (imagery systems, subjects)
total_countYesTotal number of nexuses across all categories

Implementation Reference

  • Core handler function that returns the global _nexus_registry after checking initialization. This contains the actual tool logic.
    async def get_all_nexuses() -> NexusRegistry:
        """Get all nexuses (themes/motifs/forms) from the registry.
    
        Returns complete registry with all nexus entries, organized by category.
        Use this to discover available themes, motifs, and forms for tagging poems.
    
        Returns:
            NexusRegistry with themes, motifs, and forms
    
        Example:
            >>> registry = await get_all_nexuses()
            >>> registry.total_count
            25
            >>> [t.name for t in registry.themes[:3]]
            ['Water-Liquid', 'Body-Bones', 'Childhood']
            >>> registry.themes[0].canonical_tag
            'water-liquid'
        """
        if _nexus_registry is None:
            raise RuntimeError("Enrichment tools not initialized. Call initialize_enrichment_tools() first.")
    
        return _nexus_registry
  • MCP tool registration using @mcp.tool() decorator. Delegates to the core handler in enrichment_tools.py.
    @mcp.tool()
    async def get_all_nexuses() -> NexusRegistry:
        """
        Get all nexuses (themes/motifs/forms) from the registry.
    
        Returns complete registry with all nexus entries, organized by category.
        Use this to discover available themes, motifs, and forms for tagging poems.
    
        Returns:
            NexusRegistry with themes, motifs, and forms
    
        Example:
            Get all available themes:
            ```
            registry = await get_all_nexuses()
            for theme in registry.themes:
                print(f"{theme.name} → #{theme.canonical_tag}")
            ```
        """
        return await _get_all_nexuses()
  • Pydantic model defining the return type NexusRegistry, including fields for themes, motifs, forms, and total_count.
    class NexusRegistry(BaseModel):
        """
        Complete nexus registry organized by category.
    
        Returned by get_all_nexuses() tool.
        """
    
        themes: list[Nexus] = Field(
            default_factory=list,
            description="Thematic nexuses (imagery systems, subjects)"
        )
    
        motifs: list[Nexus] = Field(
            default_factory=list,
            description="Motif nexuses (compositional patterns)"
        )
    
        forms: list[Nexus] = Field(
            default_factory=list,
            description="Form nexuses (structural patterns)"
        )
    
        total_count: int = Field(
            ...,
            description="Total number of nexuses across all categories"
        )
  • Helper function that initializes the global _nexus_registry by loading from config.vault.path, required before calling get_all_nexuses.
    def initialize_enrichment_tools(catalog: Catalog) -> None:
        """Initialize global state for enrichment tools.
    
        Args:
            catalog: Catalog instance to use for lookups
        """
        global _catalog, _nexus_registry
        _catalog = catalog
    
        # Load nexus registry on initialization
        config = load_config()
        _nexus_registry = load_nexus_registry(config.vault.path)
  • Import and alias of get_all_nexuses from enrichment_tools.py for use in server tool wrappers.
    from .tools.enrichment_tools import (
        initialize_enrichment_tools,
        get_all_nexuses as _get_all_nexuses,
        link_poem_to_nexus as _link_poem_to_nexus,
        find_nexuses_for_poem as _find_nexuses_for_poem,
        get_poems_for_enrichment as _get_poems_for_enrichment,
        sync_nexus_tags as _sync_nexus_tags,
        move_poem_to_state as _move_poem_to_state,
        grade_poem_quality as _grade_poem_quality,
    )
Behavior3/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. It describes the return structure ('complete registry with all nexus entries, organized by category') and includes an example, but lacks details on potential limitations like rate limits, authentication needs, or error handling. It does not contradict any annotations.

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 front-loaded with the core purpose, followed by usage guidance, return details, and an example. It is appropriately sized, but the example could be slightly more concise. Most sentences add value, with minimal waste.

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

Completeness5/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 (0 parameters, simple read operation), the description provides complete context: purpose, usage, return structure, and an example. The presence of an output schema means return values need not be detailed, and the description adequately covers what's needed for a straightforward registry retrieval tool.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on output and usage without redundant parameter details, earning a baseline score of 4 for effectively handling a parameter-less tool.

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

Purpose5/5

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

The description clearly states the verb ('Get') and resource ('all nexuses'), specifies what nexuses are ('themes/motifs/forms'), and distinguishes from siblings by indicating this retrieves the complete registry for discovery purposes, unlike tools like 'find_nexuses_for_poem' or 'link_poem_to_nexus' that focus on specific poems or tagging.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use it ('Use this to discover available themes, motifs, and forms for tagging poems'), providing clear context. However, it does not specify when not to use it or name alternatives among siblings, such as 'find_nexuses_for_poem' for poem-specific queries.

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/james-livefront/poetry-mcp'

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