Skip to main content
Glama
alterlab-mcp-server

alterlab-mcp-server

Extract Structured Data

alterlab_extract
Read-onlyIdempotent

Extract structured JSON fields like prices, product info, or contact details from HTML, text, or markdown you already have—without fetching a URL. Use when you have content and need specific fields.

Instructions

Turn content you already hold (HTML, text or markdown) into structured JSON fields such as prices, product info, contact details or custom fields, without fetching anything. Use when you have content and need specific fields. Does not fetch a URL: to fetch and extract in one step, use alterlab_scrape with extraction_schema. LLM extraction (extraction_prompt, extraction_schema) requires your own LLM API key (OpenAI, Anthropic, OpenRouter, etc.) added in the dashboard BYOK settings; without one it fails with byok_key_required. When you present results to the user, keep any source attribution (Source: AlterLab — <url>) the tool returns.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "content": "<content>"
    },
    "name": "alterlab_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
cacheNoCache control for LLM extraction results. 'auto': return cached result if available (default). 'skip': bypass cache lookup, always call LLM (result is still stored). 'only': return cached result or 404 if not cached — never calls the LLM.auto
contentYesRaw content to extract from — HTML, text, or markdown. Bring your own pre-fetched content; this endpoint does NOT scrape a URL.
formatsNoOutput formats for content transformation. 'json' is best for structured extraction. 'content' returns filtered/cleaned content. 'raw' returns the unprocessed response body.
evidenceNoInclude field provenance/evidence for extracted fields (which part of the content each field came from)
cache_ttlNoTTL for caching this extraction result, in seconds. Defaults to server setting (3600s). Max 86400s (24 hours).
source_urlNoOriginal URL of the content (for context only — not fetched). Helps the extractor understand the content's domain.
content_typeNoType of the provided contenthtml
extraction_modelNoPer-request LLM model override in provider-specific format (e.g. 'gpt-4o', 'claude-opus-4-5-20251101', 'llama3-70b-8192'). Overrides the model saved in your BYOK key settings for this request only.
extraction_promptNoNatural language instructions for LLM extraction (e.g., 'Extract all product prices and ratings'). Charged at LLM extraction rate when provided.
extraction_schemaNoCustom JSON Schema for extraction. Fields are mapped from content. Overrides extraction_profile when provided
extraction_profileNoPre-defined extraction profile. 'product' extracts price/title/reviews, 'article' extracts title/author/body, etc. 'auto' detects the page type. Mutually exclusive with extraction_template.
extraction_providerNoLLM provider to use for extraction. Selects the matching BYOK key registered at /dashboard/settings/llm-keys. When omitted, the most recently used registered key is used.
extraction_templateNoShorthand alias for extraction_profile — selects the same pre-built schema template. Mutually exclusive with extraction_profile.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.9.0
    • addedInput schema / properties / content / maxLength
      Added value: +500000
    • addedInput schema / properties / extraction_model / anyOf
      Added value: +[
      +  {
      +    "maxLength": 256,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / extraction_model / type
      Removed value: -[
      -  "string",
      -  "null"
      -]
  2. First observedv1.5.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnlyHint, idempotentHint, destructiveHint false, openWorldHint false), yet the description adds non-obvious behavior: LLM extraction requires a BYOK key registered in dashboard settings, and without one it fails with the specific error 'byok_key_required'. It also imposes a result-handling obligation (retain the `Source: AlterLab — <url>` attribution), which no annotation or schema conveys.

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?

Front-loaded with purpose, then exclusion, then alternative, then the operational prerequisite — a sensible priority order with little waste. The closing attribution instruction is slightly tangential to tool selection but is genuinely actionable, so it earns its place.

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 13-parameter, no-output-schema tool this covers the essentials an agent needs to call it successfully: input type expectations, the no-fetch constraint, the BYOK prerequisite and its failure mode, and where to go for fetch-plus-extract. Only caching semantics and the profile/template mutual exclusion go unaddressed, and both are adequately handled by the schema.

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 enum, cache, and extraction parameters are already fully documented in the input schema. The description only adds context around extraction_prompt/extraction_schema (they trigger LLM billing and require BYOK) and does not explain the profile-vs-template alias or the cache modes, which remain schema-only knowledge. Baseline 3 is appropriate when the schema carries the parameter burden.

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?

States a specific verb and resource ('turn content you already hold ... into structured JSON fields') and enumerates concrete field families (prices, product info, contact details, custom fields). It also explicitly carves out its boundary against alterlab_scrape, so an agent can distinguish the two without inspecting schemas.

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?

Gives the positive trigger ('Use when you have content and need specific fields'), the explicit exclusion ('Does not fetch a URL'), and the named alternative with the selecting parameter ('use alterlab_scrape with extraction_schema'). Nothing about routing between the two tools is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.