Skip to main content
Glama

pipeline

Search web pages and extract structured data from top results in a single operation using a defined JSON schema.

Instructions

Search + extract in one call. The killer feature — find pages via search, then extract structured data from top results. Costs 3+ credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find relevant pages
schemaYesJSON schema defining data to extract from results
max_resultsNoMax search results (default: 10)
extract_fromNoNumber of top results to extract from (default: 5)

Implementation Reference

  • The handler function for the 'pipeline' tool that executes the search + extract logic. It calls apiPost('/pipeline', ...) with the query, schema, max_results, and extract_from parameters, then formats the result using jsonResult().
    async ({ query, schema, max_results, extract_from }) =>
      jsonResult(await apiPost("/pipeline", { query, schema, max_results, extract_from }))
  • Input schema definition for the 'pipeline' tool using Zod. Defines 4 parameters: query (string, required), schema (record, required), max_results (number, optional, default 10), and extract_from (number, optional, default 5).
    {
      query: z.string().describe("Search query to find relevant pages"),
      schema: z.record(z.unknown()).describe("JSON schema defining data to extract from results"),
      max_results: z.number().optional().default(10).describe("Max search results (default: 10)"),
      extract_from: z.number().optional().default(5).describe("Number of top results to extract from (default: 5)"),
    },
  • src/index.ts:183-194 (registration)
    Complete registration of the 'pipeline' tool with the MCP server using server.tool(). Includes tool name, description, input schema, and handler function.
    server.tool(
      "pipeline",
      "Search + extract in one call. The killer feature — find pages via search, then extract structured data from top results. Costs 3+ credits.",
      {
        query: z.string().describe("Search query to find relevant pages"),
        schema: z.record(z.unknown()).describe("JSON schema defining data to extract from results"),
        max_results: z.number().optional().default(10).describe("Max search results (default: 10)"),
        extract_from: z.number().optional().default(5).describe("Number of top results to extract from (default: 5)"),
      },
      async ({ query, schema, max_results, extract_from }) =>
        jsonResult(await apiPost("/pipeline", { query, schema, max_results, extract_from }))
    );
  • Helper function apiPost() that makes HTTP POST requests to the SearchClaw API with timeout handling, error handling, and JSON response parsing. Used by the pipeline tool handler.
    async function apiPost(path: string, body: Record<string, unknown>) {
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 30000);
      try {
        const response = await fetch(`${API_BASE}${path}`, {
          method: "POST",
          headers: { ...headers, "Content-Type": "application/json" },
          body: JSON.stringify(body),
          signal: controller.signal,
        });
        if (!response.ok) {
          const text = await response.text();
          throw new Error(`SearchClaw API error ${response.status}: ${text}`);
        }
        return response.json();
      } finally {
        clearTimeout(timeout);
      }
    }
  • Helper function jsonResult() that formats API responses into the MCP tool result format with proper content type and JSON stringification.
    function jsonResult(data: unknown) {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
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 adds valuable context about costs ('Costs 3+ credits'), which is not covered by the schema. However, it doesn't describe other behavioral traits like rate limits, authentication needs, or what happens during execution (e.g., error handling, timeouts), leaving gaps for a mutation-like tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with three concise sentences that each earn their place: the first states the core functionality, the second elaborates on the feature, and the third adds critical cost information. There is zero waste or redundancy.

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

Completeness3/5

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

Given the tool's complexity (combining search and extraction), no annotations, and no output schema, the description is incomplete. It covers purpose and costs but lacks details on behavioral aspects (e.g., execution flow, error cases) and output format, which are essential for an agent to use it correctly. It's adequate but has clear gaps.

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 no specific parameter semantics beyond what the schema provides (e.g., it doesn't explain 'schema' beyond 'JSON schema defining data to extract'). 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.

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('search + extract') and resources ('pages', 'structured data'), distinguishing it from siblings like 'search', 'extract', and 'crawl' by emphasizing the combined functionality. It explicitly mentions the 'killer feature' of finding pages via search and extracting structured data from top results in one call.

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 ('find pages via search, then extract structured data from top results'), implying it's for combined search-and-extract tasks. However, it lacks explicit guidance on when not to use it or alternatives (e.g., using 'search' and 'extract' separately), which prevents a perfect score.

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/CSteenkamp/searchclaw-mcp'

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