Skip to main content
Glama
james-livefront

Poetry MCP Server

list_poems_by_state

Filter and browse poems by their current development state to organize your poetry collection and track writing progress across different stages.

Instructions

List poems in a specific state.

Args: state: State to filter by (completed, fledgeling, still_cooking, etc.) sort_by: Field to sort by (title, created_at, updated_at, word_count) limit: Maximum number of results

Returns: List of poems in the specified state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes
sort_byNotitle
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers the tool and implements the core logic: fetches poems by state from the catalog index, sorts by specified field, applies limit, strips content, and returns the list.
    @mcp.tool()
    async def list_poems_by_state(
        state: str,
        sort_by: str = "title",
        limit: int = 100
    ) -> List[Poem]:
        """
        List poems in a specific state.
    
        Args:
            state: State to filter by (completed, fledgeling, still_cooking, etc.)
            sort_by: Field to sort by (title, created_at, updated_at, word_count)
            limit: Maximum number of results
    
        Returns:
            List of poems in the specified state
        """
        cat = get_catalog()
    
        poems = cat.index.get_by_state(state)
    
        # Sort by requested field
        if sort_by == "title":
            poems.sort(key=lambda p: p.title.lower())
        elif sort_by == "created_at":
            poems.sort(key=lambda p: p.created_at, reverse=True)
        elif sort_by == "updated_at":
            poems.sort(key=lambda p: p.updated_at, reverse=True)
        elif sort_by == "word_count":
            poems.sort(key=lambda p: p.word_count, reverse=True)
    
        # Limit results
        poems = poems[:limit]
    
        # Remove content
        poems = [
            Poem(**{**p.model_dump(), 'content': None})
            for p in poems
        ]
    
        return poems
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool 'List poems' but doesn't disclose behavioral traits like whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior, or what happens with invalid states. The description is minimal and lacks critical operational context.

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 organized sections for Args and Returns. Every sentence adds value: the first states the purpose, and the subsequent lines explain parameters and return value without redundancy. It's appropriately sized and front-loaded.

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 3 parameters with 0% schema coverage and no annotations, the description partially compensates by explaining parameter semantics. However, it lacks behavioral transparency details (e.g., read-only nature, error handling). The output schema exists, so return values don't need explanation, but overall completeness is moderate due to missing operational context.

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?

Schema description coverage is 0%, so the description must compensate. It provides semantic meaning for all three parameters: 'state' (filter by state with examples), 'sort_by' (field to sort by with options), and 'limit' (maximum results). This adds valuable context beyond the bare schema, though it doesn't specify format details like state enum values or limit ranges.

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 poems in a specific state.' It specifies the verb ('List') and resource ('poems') with a filtering condition ('in a specific state'). However, it doesn't explicitly differentiate from siblings like 'find_poems_by_tag' or 'search_poems' beyond the state filtering aspect.

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. With siblings like 'find_poems_by_tag', 'search_poems', and 'get_poems_for_enrichment', there's no indication of when state-based filtering is preferred over other filtering methods or what prerequisites might exist.

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