Skip to main content
Glama

get_website_urls

Extract and filter website URLs based on search queries to identify relevant pages for content analysis or research purposes.

Instructions

Search and retrieve relevant URLs from a website

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the website to map.
search_queryYesThe search query to sort URLs by.

Implementation Reference

  • The async handler function that implements the core logic: sends a POST request to the Olostep Map API with the provided URL and search query to retrieve relevant URLs.
    handler: async ({ url, search_query }: { url: string; search_query: string }, apiKey: string) => {
        try {
            const headers = new Headers({
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${apiKey}`
            });
    
            const payload = {
                url: url,
                search_query: search_query,
                top_n: 100
            };
    
            const response = await fetch(OLOSTEP_MAP_API_URL, {
                method: 'POST',
                headers: headers,
                body: JSON.stringify(payload)
            });
    
            if (!response.ok) {
                const errorDetails = await response.json();
                return {
                    isError: true,
                    content: [{
                        type: "text",
                        text: `Olostep API Error: ${response.status} ${response.statusText}. Details: ${JSON.stringify(errorDetails)}`
                    }]
                };
            }
    
            const data = await response.json() as OlostepMapApiResponse;
    
            if (data.urls && data.urls.length > 0) {
                return {
                    content: [{
                        type: "text",
                        text: `Found ${data.urls_count} URLs matching your query:\n\n${data.urls.join('\n')}`
                    }]
                };
            } else {
                return {
                    content: [{
                        type: "text",
                        text: "No URLs found matching your search query."
                    }]
                };
            }
    
        } catch (error: unknown) {
            return {
                isError: true,
                content: [{
                    type: "text",
                    text: `Error: Failed to fetch website map. ${error instanceof Error ? error.message : String(error)}`
                }]
            };
        }
    }
  • Zod schema defining the input parameters for the tool: 'url' (website URL) and 'search_query' (query to match URLs).
    schema: {
        url: z.string().url().describe("The URL of the website to map."),
        search_query: z.string().describe("The search query to sort URLs by."),
    },
  • src/index.ts:148-161 (registration)
    Tool registration using McpServer.tool(), including API key check and content type normalization.
    // Register the website map tool
    server.tool(
        getWebsiteMap.name,
        getWebsiteMap.description,
        getWebsiteMap.schema,
        async (params) => {
            if (!OLOSTEP_API_KEY) return missingApiKeyError;
            const result = await getWebsiteMap.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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'search and retrieve' but doesn't explain how the search works (e.g., depth, scope, or limitations), what 'relevant' means, potential rate limits, or authentication needs. This leaves significant gaps for a tool that interacts with external websites.

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 directly states the tool's function without unnecessary words. It's front-loaded and appropriately sized for its purpose, earning full marks for conciseness.

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 complexity of web interaction tools and the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, return format, or limitations, which are crucial for an agent to use this tool effectively in real-world scenarios.

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 both parameters ('url' and 'search_query') adequately. The description implies these parameters are used for searching and retrieving, but doesn't add meaningful semantic context beyond what the schema provides, such as examples or constraints on the search query.

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 with specific verbs ('search and retrieve') and resource ('relevant URLs from a website'). However, it doesn't explicitly distinguish this tool from sibling tools like 'scrape_website' or 'search_web', which might have overlapping functionality, preventing 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. With multiple sibling tools like 'scrape_website', 'google_search', and 'search_web', there's no indication of context, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

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