Skip to main content
Glama
james-livefront

Poetry MCP Server

grade_poem_quality

Analyze poems across 8 quality dimensions including imagery, rhythm, depth, and coherence. Provides structured rubric for scoring poems from 0-10 with detailed reasoning for each evaluation criterion.

Instructions

Prepare poem and quality rubric for grading by the MCP agent.

Returns poem content and quality dimension descriptions for YOU (the agent) to grade. YOU provide scores (0-10) and reasoning for each dimension.

8 Quality Dimensions:

  • Detail: Vividness and specificity of imagery

  • Life: Living, breathing quality and vitality

  • Music: Sound quality and rhythmic elements

  • Mystery: Ambiguity, layers, reader engagement

  • Sufficient Thought: Intellectual depth and insight

  • Surprise: Unexpected elements, fresh perspectives

  • Syntax: Sentence structure and line breaks

  • Unity: Coherence and wholeness

Args: poem_id: Poem identifier (ID or title) dimensions: Optional list of specific dimensions to grade (default: all 8)

Returns: Dictionary with: - poem: Poem data (title, content) - dimensions: Quality dimensions with descriptions - instructions: Grading guidance

Example workflow: ``` # 1. Get poem and rubric data = await grade_poem_quality("antlion")

# 2. YOU grade data['poem'] on data['dimensions']
# 3. YOU provide scores 0-10 with reasoning for each dimension
#    - 0-3: Absent/poor
#    - 4-6: Adequate
#    - 7-8: Strong
#    - 9-10: Exceptional
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poem_idYes
dimensionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that implements the grade_poem_quality tool logic: retrieves the poem, loads its content, defines the 8 quality dimensions, prepares data and instructions for the MCP agent to perform the actual grading.
    async def grade_poem_quality(
        poem_id: str,
        dimensions: Optional[List[str]] = None,
    ) -> dict:
        """Prepare poem and quality rubric for grading by the MCP agent.
    
        Returns poem content and quality dimension descriptions for the agent to grade.
        Agent provides scores (0-10) and reasoning for each dimension.
    
        Quality dimensions:
        - Detail: Vividness and specificity of imagery
        - Life: Living, breathing quality and vitality
        - Music: Sound quality and rhythmic elements
        - Mystery: Ambiguity, layers, reader engagement
        - Sufficient Thought: Intellectual depth and insight
        - Surprise: Unexpected elements, fresh perspectives
        - Syntax: Sentence structure and line breaks
        - Unity: Coherence and wholeness
    
        Args:
            poem_id: Poem identifier (ID or title)
            dimensions: Optional list of specific dimensions to grade (default: all 8)
    
        Returns:
            Dictionary with:
            - poem: Poem data (id, title, content)
            - dimensions: Quality dimensions with descriptions
            - instructions: Grading guidance for agent
    
        Example:
            >>> result = await grade_poem_quality("antlion")
            >>> # Agent grades result['poem'] on result['dimensions']
            >>> # Agent returns scores 0-10 with reasoning for each
        """
        if _catalog is None:
            raise RuntimeError("Enrichment tools not initialized.")
    
        # Get poem
        poem = _catalog.index.get_poem(poem_id)
        if not poem:
            return {
                "success": False,
                "error": f"Poem not found: {poem_id}",
            }
    
        # Load content if needed
        content = poem.content
        if not content:
            try:
                poem_path = Path(poem.file_path)
                full_content = poem_path.read_text(encoding='utf-8')
                if '---' in full_content:
                    parts = full_content.split('---', 2)
                    if len(parts) >= 3:
                        content = parts[2].strip()
                    else:
                        content = full_content
                else:
                    content = full_content
            except Exception as e:
                return {
                    "success": False,
                    "error": f"Failed to load poem content: {e}",
                }
    
        # Define all quality dimensions
        all_dimensions = {
            "Detail": "Vividness and specificity of imagery - concrete sensory details vs abstract generalities",
            "Life": "Living, breathing quality - vitality, energy, movement vs static or lifeless",
            "Music": "Sound quality - rhythm, sonic patterns, musicality of language",
            "Mystery": "Ambiguity and layers - capacity to engage reader in meaning-making",
            "Sufficient Thought": "Intellectual depth - insight, wisdom, meaningful observation",
            "Surprise": "Unexpected elements - fresh perspectives, original connections",
            "Syntax": "Sentence structure and line breaks - how grammar serves meaning",
            "Unity": "Coherence and wholeness - integration of parts into cohesive whole",
        }
    
        # Filter to requested dimensions if specified
        if dimensions:
            dimensions_to_grade = {k: v for k, v in all_dimensions.items() if k in dimensions}
            if not dimensions_to_grade:
                return {
                    "success": False,
                    "error": f"Invalid dimensions. Valid options: {list(all_dimensions.keys())}",
                }
        else:
            dimensions_to_grade = all_dimensions
    
        # Format dimensions for agent
        dimensions_data = [
            {"name": name, "description": desc}
            for name, desc in dimensions_to_grade.items()
        ]
    
        instructions = """Grade this poem on each quality dimension.
    
    For each dimension, provide:
    - **dimension**: Dimension name (exactly as listed)
    - **score**: Integer 0-10
      - 0-3: Absent or poor
      - 4-6: Adequate, functional
      - 7-8: Strong, effective
      - 9-10: Exceptional, masterful
    - **reasoning**: Brief evidence (1-2 sentences, cite specific lines)
    
    Be precise and evidence-based. Reference specific techniques or lines when explaining scores."""
    
        logger.info(f"Prepared quality grading data for '{poem.title}' ({len(dimensions_to_grade)} dimensions)")
    
        return {
            "success": True,
            "poem": {
                "id": poem.id,
                "title": poem.title,
                "content": content,
                "state": poem.state,
            },
            "dimensions": dimensions_data,
            "instructions": instructions,
            "dimensions_count": len(dimensions_to_grade),
        }
  • MCP registration of the grade_poem_quality tool using @mcp.tool() decorator. This wrapper delegates to the core implementation imported as _grade_poem_quality from enrichment_tools.py.
    @mcp.tool()
    async def grade_poem_quality(
        poem_id: str,
        dimensions: Optional[List[str]] = None,
    ) -> dict:
        """
        Prepare poem and quality rubric for grading by the MCP agent.
    
        Returns poem content and quality dimension descriptions for YOU (the agent) to grade.
        YOU provide scores (0-10) and reasoning for each dimension.
    
        8 Quality Dimensions:
        - Detail: Vividness and specificity of imagery
        - Life: Living, breathing quality and vitality
        - Music: Sound quality and rhythmic elements
        - Mystery: Ambiguity, layers, reader engagement
        - Sufficient Thought: Intellectual depth and insight
        - Surprise: Unexpected elements, fresh perspectives
        - Syntax: Sentence structure and line breaks
        - Unity: Coherence and wholeness
    
        Args:
            poem_id: Poem identifier (ID or title)
            dimensions: Optional list of specific dimensions to grade (default: all 8)
    
        Returns:
            Dictionary with:
            - poem: Poem data (title, content)
            - dimensions: Quality dimensions with descriptions
            - instructions: Grading guidance
    
        Example workflow:
            ```
            # 1. Get poem and rubric
            data = await grade_poem_quality("antlion")
    
            # 2. YOU grade data['poem'] on data['dimensions']
            # 3. YOU provide scores 0-10 with reasoning for each dimension
            #    - 0-3: Absent/poor
            #    - 4-6: Adequate
            #    - 7-8: Strong
            #    - 9-10: Exceptional
            ```
        """
        return await _grade_poem_quality(poem_id, dimensions)
  • Helper dictionary defining the 8 quality dimensions with descriptions, used to prepare grading rubric for the agent.
    all_dimensions = {
        "Detail": "Vividness and specificity of imagery - concrete sensory details vs abstract generalities",
        "Life": "Living, breathing quality - vitality, energy, movement vs static or lifeless",
        "Music": "Sound quality - rhythm, sonic patterns, musicality of language",
        "Mystery": "Ambiguity and layers - capacity to engage reader in meaning-making",
        "Sufficient Thought": "Intellectual depth - insight, wisdom, meaningful observation",
        "Surprise": "Unexpected elements - fresh perspectives, original connections",
        "Syntax": "Sentence structure and line breaks - how grammar serves meaning",
        "Unity": "Coherence and wholeness - integration of parts into cohesive whole",
    }
  • Import of the grade_poem_quality function from enrichment_tools.py, aliased as _grade_poem_quality for use in the MCP tool wrapper.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly describes what the tool returns (poem data, dimensions, instructions) and the grading workflow, but doesn't mention potential limitations like error handling, authentication needs, or rate limits. The behavioral information is adequate but not comprehensive.

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 well-structured with clear sections (purpose, dimensions list, args, returns, workflow) but could be more concise. The 8 dimensions list and detailed example workflow are valuable but make it somewhat lengthy. Every sentence serves a purpose, but some information could be more efficiently presented.

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

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (preparing grading materials with 8 quality dimensions) and the presence of an output schema, the description provides good context. It explains the grading dimensions, parameters, return structure, and workflow. The output schema means it doesn't need to detail return values, but it still provides helpful context about the grading process.

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?

With 0% schema description coverage, the description must compensate for the schema's lack of parameter documentation. It explains both parameters: 'poem_id' as 'Poem identifier (ID or title)' and 'dimensions' as 'Optional list of specific dimensions to grade (default: all 8)'. It also lists the 8 possible dimensions, providing essential context missing from the schema.

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 tool's purpose with specific verbs ('prepare poem and quality rubric for grading') and resources ('poem content and quality dimension descriptions'). It distinguishes itself from sibling tools like 'get_poem' by emphasizing the grading preparation aspect rather than just retrieval.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool versus alternatives through the example workflow, which shows it's for preparing grading materials. It implicitly distinguishes from siblings like 'get_poem' (which just retrieves poems) and 'search_poems' (which searches without grading context).

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