Skip to main content
Glama

getWorkbookContent

Extracts and formats Christian Life and Ministry workbook content from RTF files, converting them into clean plain text with proper structure after users select a specific week.

Instructions

STEP 2: Get the actual CLM workbook content after user chooses a week. Use this tool AFTER getWorkbookLinks when user specifies which week they want (e.g., "May 5-11" or "June 30-July 6"). Takes the RTF URL from Step 1 results, downloads the RTF file, parses it to clean plain text, and returns the formatted workbook content with proper line breaks and structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe RTF file URL from getWorkbookLinks results (e.g., "https://cfp2.jw-cdn.org/a/...")

Implementation Reference

  • Core handler function that downloads RTF content from the provided URL, parses it to plain text, and returns structured result with metadata.
    export async function getWorkbookContent(url) {
      const rtfData = await downloadRtfContent(url);
    
      try {
        // Parse RTF to plain text
        const parsedText = parseRTF(rtfData.content);
    
        return {
          url: rtfData.url,
          contentType: rtfData.contentType,
          originalSize: rtfData.size,
          parsedText: parsedText,
          parsedSize: parsedText.length
        };
      } catch (error) {
        throw new Error(`Failed to parse RTF content: ${error.message}`);
      }
    }
  • Input schema and metadata definition for the getWorkbookContent tool, part of the workbookTools array.
    {
      name: 'getWorkbookContent',
      description: 'STEP 2: Get the actual CLM workbook content after user chooses a week. Use this tool AFTER getWorkbookLinks when user specifies which week they want (e.g., "May 5-11" or "June 30-July 6"). Takes the RTF URL from Step 1 results, downloads the RTF file, parses it to clean plain text, and returns the formatted workbook content with proper line breaks and structure.',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'The RTF file URL from getWorkbookLinks results (e.g., "https://cfp2.jw-cdn.org/a/...")'
          }
        },
        required: ['url']
      }
    }
  • src/index.js:33-41 (registration)
    Spreads workbookTools (containing getWorkbookContent schema) into the server's allTools array for tool listing (ListToolsRequestHandler).
    const allTools = [
      captionsTool,
      ...workbookTools,
      ...watchtowerTools,
      searchBibleBooksTool,
      getBibleVerseTool,
      getVerseWithStudyTool,
      getBibleVerseURLTool
    ];
  • src/index.js:44-49 (registration)
    Registers handleWorkbookTools (which dispatches getWorkbookContent) into the server's toolHandlers array for tool execution (CallToolRequestHandler).
    const toolHandlers = [
      handleCaptionsTool,
      handleWorkbookTools,
      handleWatchtowerTools,
      handleScriptureTools
    ];
  • Tool dispatcher logic within handleWorkbookTools that validates input, calls getWorkbookContent, formats response for MCP, and handles errors.
    // Handle getWorkbookContent tool  
    if (request.params.name === 'getWorkbookContent') {
      try {
        const { url } = request.params.arguments;
        
        if (!url) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: URL parameter is required',
              },
            ],
            isError: true,
          };
        }
        
        const result = await getWorkbookContent(url);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
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 describes the tool's processing steps (download, parse, clean, format) and output characteristics ('formatted workbook content with proper line breaks and structure'), which is helpful. However, it doesn't address potential behavioral aspects like error handling, rate limits, authentication requirements, or file size limitations that might be relevant for a download and parsing operation.

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 appropriately sized and front-loaded with the most important information (when to use the tool). Every sentence adds value, though the 'STEP 2' framing could be slightly more concise. The structure effectively guides the agent through the workflow context and tool purpose.

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?

For a single-parameter tool with no output schema and no annotations, the description does a good job explaining the tool's purpose, usage context, and processing behavior. It could be more complete by addressing potential error cases or output format details, but given the tool's relative simplicity and clear workflow positioning, it provides sufficient context for effective use.

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?

The schema description coverage is 100%, so the schema already documents the single parameter. The description adds meaningful context by specifying that the URL should come 'from getWorkbookLinks results' and provides an example URL pattern, which helps the agent understand the parameter's provenance and format beyond the basic schema definition.

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 ('downloads the RTF file, parses it to clean plain text, and returns the formatted workbook content') and resource ('CLM workbook content'), distinguishing it from sibling tools like getWorkbookLinks (which provides links) and getWatchtowerContent (which handles different content). It explicitly mentions the tool's role in a two-step workflow.

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 ('AFTER getWorkbookLinks when user specifies which week they want') and includes examples of user input ('e.g., "May 5-11" or "June 30-July 6"'). It clearly positions this as Step 2 in a specific workflow, making the usage context unambiguous.

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/advenimus/jw-mcp'

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