Skip to main content
Glama

compare_plays

Analyze and contrast two dramatic plays by comparing their structural metrics and textual features to identify similarities and differences.

Instructions

Compare two plays in terms of metrics and structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
corpus_name1Yes
play_name1Yes
corpus_name2Yes
play_name2Yes

Implementation Reference

  • The complete implementation of the 'compare_plays' tool, including registration via the @mcp.tool() decorator and the handler function that fetches play metadata and metrics for two specified plays from the DraCor API and compiles them into a comparison structure. The input schema is defined by the function parameters.
    @mcp.tool() def compare_plays( corpus_name1: str, play_name1: str, corpus_name2: str, play_name2: str ) -> Dict: """Compare two plays in terms of metrics and structure.""" try: play1 = api_request(f"corpora/{corpus_name1}/plays/{play_name1}") play2 = api_request(f"corpora/{corpus_name2}/plays/{play_name2}") metrics1 = api_request(f"corpora/{corpus_name1}/plays/{play_name1}/metrics") metrics2 = api_request(f"corpora/{corpus_name2}/plays/{play_name2}/metrics") # Compile comparison data comparison = { "plays": [ { "title": play1.get("title"), "author": play1.get("authors", [{}])[0].get("name") if play1.get("authors") else None, "year": play1.get("yearNormalized"), "metrics": metrics1 }, { "title": play2.get("title"), "author": play2.get("authors", [{}])[0].get("name") if play2.get("authors") else None, "year": play2.get("yearNormalized"), "metrics": metrics2 } ] } return comparison except Exception as e: return {"error": str(e)}

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/stijn-meijers/dracor-mcp'

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