Skip to main content
Glama
Sivan22

Sefaria Jewish Library MCP Server

get_text

Retrieve Jewish texts from the Sefaria Library using specific references like 'Genesis 1:1' or 'שולחן ערוך אורח חיים סימן א' for accurate access to religious scripture and literature.

Instructions

get a jewish text from the jewish library

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
referenceYesThe reference of the jewish text, e.g. 'שולחן ערוך אורח חיים סימן א' or 'Genesis 1:1'

Implementation Reference

  • Core handler function implementing the logic for the 'get_text' tool by fetching Hebrew text via helper.
    async def get_text(reference: str) -> str:
        """
        Retrieves the text for a given reference.
        """
        return str(get_hebrew_text(reference))
  • Dispatch handler in call_tool that extracts arguments and invokes the get_text function.
    if name == "get_text":
        try:
            reference = arguments.get("reference")
            if not  reference:
                raise ValueError("Missing reference parameter")  
            
            logger.debug(f"handle_get_text: {reference}")
            text = await get_text(reference)
            
            
            return [types.TextContent(
                type="text",
                text= text
            )]
        except Exception as err:
            logger.error(f"retreive text error: {err}", exc_info=True)
            return [types.TextContent(
                type="text",
                text=f"Error: {str(err)}"
            )]
  • JSON schema defining the input parameters for the 'get_text' tool (requires 'reference' string).
        "type": "object",
        "properties": {
            "reference": {
                "type": "string",
                "description": "The reference of the jewish text, e.g. 'שולחן ערוך אורח חיים סימן א' or 'Genesis 1:1'",                               
            },
        },
        "required": ["reference"],
    },
  • Registration of the 'get_text' tool in the server's list_tools response.
        name="get_text",
        description="get a jewish text from the jewish library",
        inputSchema={
            "type": "object",
            "properties": {
                "reference": {
                    "type": "string",
                    "description": "The reference of the jewish text, e.g. 'שולחן ערוך אורח חיים סימן א' or 'Genesis 1:1'",                               
                },
            },
            "required": ["reference"],
        },
    ),
  • Supporting helper that performs the actual API request to retrieve Hebrew text from Sefaria.
    def get_hebrew_text(parasha_ref):
        """
        Retrieves the Hebrew text and version title for the given verse.
        """
        data = get_request_json_data("api/v3/texts/", parasha_ref)
    
        if data and "versions" in data and len(data['versions']) > 0:
            he_pasuk = data['versions'][0]['text']
            return  he_pasuk
        else:
            print(f"Could not retrieve Hebrew text for {parasha_ref}")
            return None
Behavior2/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 of behavioral disclosure. It states the action ('get') but doesn't describe traits like whether this is a read-only operation, if it requires authentication, what happens on errors (e.g., invalid reference), or rate limits. The description is minimal and lacks essential behavioral context for a tool with no annotation support.

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 concise and front-loaded in a single sentence ('get a jewish text from the jewish library'), with zero wasted words. It efficiently states the core purpose without unnecessary elaboration, making it easy to parse. However, it's slightly under-specified given the lack of sibling differentiation and behavioral details.

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

Completeness2/5

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

Given the tool's complexity (a read operation with one parameter) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects, error handling, or output format, leaving gaps for an agent to invoke it correctly. With no structured support, the description should provide more context but falls short.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'reference' parameter well-documented in the schema (including examples like 'Genesis 1:1'). The description adds no additional parameter semantics beyond what the schema provides—it doesn't explain reference formats, constraints, or usage. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool's purpose ('get a jewish text from the jewish library'), which is clear but vague. It specifies the verb ('get') and resource ('jewish text'), but doesn't differentiate from siblings like 'search_texts' or 'get_commentaries'—it's unclear if this fetches a single text by reference versus searching. The purpose is understandable but lacks specificity for sibling distinction.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, exclusions, or compare to sibling tools like 'search_texts' (which might handle broader queries) or 'get_commentaries' (which might retrieve related content). Usage is implied from the name and description alone, with no explicit context for selection.

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

Related 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/Sivan22/mcp-sefaria-server'

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