Skip to main content
Glama

create_map

Extract all URLs from a website for discovery and site analysis. Filter results by search queries, patterns, or limit output to specific numbers.

Instructions

Get all URLs on a website. Extract URLs for discovery and site analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
website_urlYesWebsite URL to extract links from.
search_queryNoOptional search query to filter URLs (e.g., "blog").
top_nNoOptional limit for number of URLs returned.
include_url_patternsNoOptional glob patterns to include (e.g., "/blog/**").
exclude_url_patternsNoOptional glob patterns to exclude (e.g., "/admin/**").

Implementation Reference

  • The handler function that implements the core logic of the 'create_map' tool. It constructs a payload from input parameters, sends a POST request to the Olostep Maps API, handles errors, and returns the response data.
    handler: async (
    	{
    		website_url,
    		search_query,
    		top_n,
    		include_url_patterns,
    		exclude_url_patterns,
    	}: {
    		website_url: string;
    		search_query?: string;
    		top_n?: number;
    		include_url_patterns?: string[];
    		exclude_url_patterns?: string[];
    	},
    	apiKey: string,
    ) => {
    	try {
    		const headers = new Headers({
    			"Content-Type": "application/json",
    			Authorization: `Bearer ${apiKey}`,
    		});
    
    		const payload: Record<string, unknown> = {
    			url: website_url,
    		};
    		if (search_query) payload.search_query = search_query;
    		if (typeof top_n === "number") payload.top_n = top_n;
    		if (include_url_patterns?.length) payload.include_url_patterns = include_url_patterns;
    		if (exclude_url_patterns?.length) payload.exclude_url_patterns = exclude_url_patterns;
    
    		const response = await fetch(OLOSTEP_MAP_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 OlostepCreateMapResponse;
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(data, null, 2),
    				},
    			],
    		};
    	} catch (error: unknown) {
    		return {
    			isError: true,
    			content: [
    				{
    					type: "text",
    					text: `Error: Failed to create map. ${error instanceof Error ? error.message : String(error)}`,
    				},
    			],
    		};
    	}
    },
  • Zod-based input schema defining parameters for the 'create_map' tool: website_url (required), and optional search_query, top_n, include_url_patterns, exclude_url_patterns.
    schema: {
    	website_url: z.string().url().describe("Website URL to extract links from."),
    	search_query: z.string().optional().describe('Optional search query to filter URLs (e.g., "blog").'),
    	top_n: z.number().int().min(1).optional().describe("Optional limit for number of URLs returned."),
    	include_url_patterns: z
    		.array(z.string())
    		.optional()
    		.describe('Optional glob patterns to include (e.g., "/blog/**").'),
    	exclude_url_patterns: z
    		.array(z.string())
    		.optional()
    		.describe('Optional glob patterns to exclude (e.g., "/admin/**").'),
    },
  • src/index.ts:44-56 (registration)
    Registers the 'create_map' tool with the MCP server, wrapping the handler to check for API key and normalize content type.
    server.tool(
        createMap.name,
        createMap.description,
        createMap.schema,
        async (params) => {
            if (!OLOSTEP_API_KEY) return missingApiKeyError;
            const result = await createMap.handler(params, OLOSTEP_API_KEY);
            return {
                ...result,
                content: result.content.map(item => ({ ...item, type: item.type as "text" }))
            };
        }
    );
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. It states the tool extracts URLs but doesn't describe how it works (e.g., crawling depth, handling of dynamic content, rate limits, authentication needs, or error conditions). The phrase 'Get all URLs' might imply comprehensive extraction, but without behavioral details, the agent lacks transparency about what to expect from the operation.

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 extremely concise and front-loaded: the first sentence 'Get all URLs on a website' directly states the core purpose. The second sentence adds context about use cases without redundancy. Every word earns its place, making it efficient and easy to parse for an AI agent.

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?

Given the tool's complexity (5 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what the tool returns (e.g., list structure, error formats), behavioral constraints, or how it differs from similar siblings. For a URL extraction tool with multiple filtering options, more context is needed to guide effective use, especially without annotations or output 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?

The input schema has 100% description coverage, providing clear documentation for all 5 parameters. The description adds minimal value beyond this, only implying URL extraction without detailing parameter interactions or usage examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, though the description could have enhanced understanding with practical context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Get all URLs on a website' specifies the verb (get/extract) and resource (URLs from a website). It distinguishes from some siblings like 'get_webpage_content' (which gets content rather than URLs) and 'google_search' (which searches the web rather than extracting from a specific site). However, it doesn't explicitly differentiate from 'get_website_urls' (which might have similar functionality), keeping it from a perfect score.

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. It mentions 'discovery and site analysis' as general use cases, but doesn't specify when to choose this over siblings like 'get_website_urls', 'scrape_website', or 'create_crawl'. There's no mention of prerequisites, limitations, or comparative advantages, leaving the agent with minimal usage context.

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