Skip to main content
Glama

create_crawl

Discover and scrape entire websites by following links from a starting URL to extract content in various formats for data collection.

Instructions

Autonomously discover and scrape entire websites by following links from a start URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_urlYesStarting URL for the crawl.
max_pagesNoMaximum number of pages to crawl.
follow_linksNoWhether to follow links found on pages.
output_formatNoFormat for scraped content. Default: "markdown".markdown
countryNoOptional country code for location-specific crawling.
parserNoOptional parser ID for specialized content extraction.

Implementation Reference

  • The async handler function that sends a POST request to Olostep API to create a crawl job based on input parameters like start_url, max_pages, etc., handles errors, and returns the response.
    handler: async (
    	{
    		start_url,
    		max_pages,
    		follow_links,
    		output_format,
    		country,
    		parser,
    	}: {
    		start_url: string;
    		max_pages?: number;
    		follow_links?: boolean;
    		output_format: "markdown" | "html" | "json" | "text";
    		country?: string;
    		parser?: string;
    	},
    	apiKey: string,
    	orbitKey?: string,
    ) => {
    	try {
    		const headers = new Headers({
    			"Content-Type": "application/json",
    			Authorization: `Bearer ${apiKey}`,
    		});
    
    		const formats: string[] = [output_format];
    		const payload: Record<string, unknown> = {
    			start_url,
    			max_pages: max_pages ?? 10,
    			follow_links: follow_links ?? true,
    			formats,
    		};
    		if (country) payload.country = country;
    		if (orbitKey) payload.force_connection_id = orbitKey;
    		if (parser) payload.parser_extract = { parser_id: parser };
    
    		const response = await fetch(OLOSTEP_CRAWL_API_URL, {
    			method: "POST",
    			headers,
    			body: JSON.stringify(payload),
    		});
    
    		if (!response.ok) {
    			let errorDetails: unknown = null;
    			try {
    				errorDetails = await response.json();
    			} catch {
    				// ignore
    			}
    			return {
    				isError: true,
    				content: [
    					{
    						type: "text",
    						text: `Olostep API Error: ${response.status} ${response.statusText}. Details: ${JSON.stringify(
    							errorDetails,
    						)}`,
    					},
    				],
    			};
    		}
    
    		const data = (await response.json()) as OlostepCrawlResponse;
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(data, null, 2),
    				},
    			],
    		};
    	} catch (error: unknown) {
    		return {
    			isError: true,
    			content: [
    				{
    					type: "text",
    					text: `Error: Failed to create crawl. ${error instanceof Error ? error.message : String(error)}`,
    				},
    			],
    		};
    	}
    },
  • Zod-based input schema defining parameters for the create_crawl tool: start_url (required URL), max_pages, follow_links, output_format, country, parser.
    schema: {
    	start_url: z.string().url().describe("Starting URL for the crawl."),
    	max_pages: z.number().int().min(1).default(10).describe("Maximum number of pages to crawl."),
    	follow_links: z.boolean().default(true).describe("Whether to follow links found on pages."),
    	output_format: z
    		.enum(["markdown", "html", "json", "text"])
    		.default("markdown")
    		.describe('Format for scraped content. Default: "markdown".'),
    	country: z.string().optional().describe("Optional country code for location-specific crawling."),
    	parser: z.string().optional().describe("Optional parser ID for specialized content extraction."),
    },
  • src/index.ts:58-71 (registration)
    MCP server registration of the create_crawl tool using server.tool(name, description, schema, handlerWrapper), which checks for API key and calls the tool handler.
    // Register Create Crawl tool
    server.tool(
        createCrawl.name,
        createCrawl.description,
        createCrawl.schema,
        async (params) => {
            if (!OLOSTEP_API_KEY) return missingApiKeyError;
            const result = await createCrawl.handler(params, OLOSTEP_API_KEY, ORBIT_KEY);
            return {
                ...result,
                content: result.content.map(item => ({ ...item, type: item.type as "text" }))
            };
        }
    );
  • TypeScript interface defining the structure of the Olostep crawl API response.
    export interface OlostepCrawlResponse {
    	crawl_id?: string;
    	object?: string;
    	status?: string;
    	start_url?: string;
    	max_pages?: number;
    	follow_links?: boolean;
    	created?: string;
    	formats?: string[];
    	country?: string;
    	parser?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions autonomous discovery and link-following, it lacks critical behavioral details like rate limits, authentication requirements, potential for being blocked by websites, or what happens when max_pages is reached. The description doesn't explain what 'scrape' entails beyond content extraction.

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 a single, efficient sentence that communicates the core functionality without unnecessary words. It's front-loaded with the main action and resource, making it immediately understandable.

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?

For a complex crawling tool with 6 parameters and no annotations or output schema, the description is insufficient. It doesn't address important contextual aspects like what the tool returns (scraped content format, error handling), performance characteristics, or limitations of autonomous website discovery.

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 additional parameter semantics beyond what's in the schema. The baseline score of 3 reflects adequate parameter documentation through the schema alone.

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 ('discover and scrape entire websites') and resource ('websites'), distinguishing it from siblings like 'scrape_website' or 'get_webpage_content' by emphasizing autonomous link-following behavior.

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?

The description provides no guidance on when to use this tool versus alternatives like 'scrape_website' or 'batch_scrape_urls'. It mentions following links but doesn't specify scenarios where this comprehensive crawling approach is preferred over targeted scraping.

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/olostep/olostep-mcp-server'

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