search-web
Retrieve web content in markdown format by querying the pure.md MCP server, enabling AI clients to access and process blocked or searchable online resources.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/index.ts:43-59 (handler)Inline handler function for the "search-web" tool. Fetches web search results from the pure.md API using the provided query, returns markdown content in MCP format, or an error message if the request fails.server.tool("search-web", { query: z.string() }, async ({ query }) => { try { const response = await fetch(`https://pure.md/search?q=${query}`, { headers: { "x-puremd-api-token": PUREMD_API_KEY }, }); const markdown = await response.text(); return { content: [{ type: "text", text: markdown }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: (error as Error).message }], isError: true, }; } });
- src/index.ts:43-43 (schema)Zod schema for the "search-web" tool input: a single required string parameter named "query".server.tool("search-web", { query: z.string() }, async ({ query }) => {
- src/index.ts:43-59 (registration)Registers the "search-web" MCP tool with server.tool(), providing schema and handler implementation.server.tool("search-web", { query: z.string() }, async ({ query }) => { try { const response = await fetch(`https://pure.md/search?q=${query}`, { headers: { "x-puremd-api-token": PUREMD_API_KEY }, }); const markdown = await response.text(); return { content: [{ type: "text", text: markdown }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: (error as Error).message }], isError: true, }; } });