Skip to main content
Glama

extract_content

Extract content from PDF rulebooks and save as CustomSource JSON for use in AI-assisted Dungeons & Dragons campaigns. Specify source, content name, and type to prepare game elements for the rulebook system.

Instructions

Extract content from a PDF source and save as CustomSource JSON.

Extracts the full content definition from a PDF source based on the table of contents entry. The extracted content is saved to the library/extracted/{source_id}/ directory in CustomSource JSON format, ready to be loaded by the rulebook system.

Examples: - extract_content("tome-of-heroes", "Fighter", "class") - extract_content("phb", "Elf", "race") - extract_content("phb", "Fireball", "spell")

Args: source_id: The source identifier (use list_library to see available sources) content_name: Name of the content to extract (as shown in TOC) content_type: Type of content (class, race, spell, monster, feat, item)

Returns: Success message with path to extracted file, or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYesThe source identifier (e.g., 'tome-of-heroes')
content_nameYesName of the content to extract (e.g., 'Fighter', 'Elf')
content_typeYesType of content to extract
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 discloses key behavioral traits: it extracts content, saves it to a specific directory ('library/extracted/{source_id}/') in a JSON format, and indicates it's for the rulebook system. However, it lacks details on permissions, error handling, or whether the operation is idempotent, which are important for a tool that writes files.

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 a clear purpose statement, examples, and a returns section, making it easy to scan. However, the 'Args' section slightly repeats schema information, and some sentences could be more streamlined (e.g., combining the extraction and saving details). Overall, it's efficient but not perfectly concise.

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 no annotations and no output schema, the description does a good job covering the tool's purpose, usage, and behavioral aspects like file output. It includes examples and return information, but lacks details on error cases or system dependencies, leaving minor gaps for a tool with file operations.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema, only reiterating parameter purposes in the 'Args' section without providing additional context like format constraints or interdependencies. Baseline 3 is appropriate given high schema coverage.

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 specific action ('Extract content from a PDF source and save as CustomSource JSON') and resource ('PDF source'), distinguishing it from sibling tools like 'search_library' or 'get_library_toc' by focusing on extraction and file creation rather than querying or listing.

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 provides clear context for when to use this tool (e.g., extracting content based on table of contents entries) and includes examples that illustrate typical use cases. However, it does not explicitly state when not to use it or name alternatives among siblings, such as 'search_library' for finding content without extraction.

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/Polloinfilzato/dm20-protocol'

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