Craft your own MCP tool
Default tools includedYour generated surface already ships a suite of default tools that work with zero configuration (business info, contact, hours, locations, socials, page list, page content, site search, latest posts, FAQ, policies, pricing, team, reviews). This is how to add your own.
Build against a data standard, degrade gracefully — never against a specific page's HTML.
A tool that scrapes a fragile CSS selector breaks the first time the theme changes. A tool that reads a standard — schema.org JSON-LD, sitemap.xml, RSS, Open Graph — keeps working, and returns null/empty when the data isn't there instead of throwing. Every default tool follows this rule.
Tier 1 — Metadata · schema.org JSON-LD · Open Graph
Business name, contact, hours, locations, social links. Near-universal — already shipped as defaults.
Tier 2 — Content & structure · sitemap.xml · RSS/Atom · robots.txt
List pages, fetch a page's text, search the site, latest posts, FAQ. Light crawling — already shipped.
Tier 3 — Page conventions · predictable URLs + schema
Policies, pricing, team, reviews. Heuristic but reliable — already shipped.
Tier 4 — Transactional · YOUR backend (Calendly, Shopify, CRM…)
book_appointment, submit_contact_form, check_product_availability, create_lead. NOT universal — each needs a real integration. This is what the extension points are for.
WordPress plugin → the ark_mcp_tool_<name> filter
// functions.php — give your declared tool real behavior
add_filter('ark_mcp_tool_book_appointment', function ($result, $args) {
$when = isset($args['datetime']) ? $args['datetime'] : null; // validate!
// ... call Calendly / your booking API here ...
return array('status' => 'booked', 'confirmation' => 'ABC123', 'when' => $when);
}, 10, 2);
// Return non-null → live. Return nothing → honest "not implemented". Never fake a success.Cloudflare Worker (or any host) → POST /api/v1/<tool>
The Worker proxies a custom tool call to your origin. Implement the endpoint to return JSON:
POST https://yoursite.com/api/v1/book-appointment
Content-Type: application/json
{ "datetime": "2026-09-01T14:00" }
→ { "status": "booked", "confirmation": "ABC123" }Until the endpoint exists, the tool returns an honest "not implemented" notice — never a fake success.
When you generate your bundle, set a primary tool: a snake_casename + a "Use this when…" description. That adds it to your MCP server-card, agent-card, andwebmcp.js. Give it a real inputSchema so agents know what to send:
{
"type": "object",
"properties": {
"datetime": { "type": "string", "description": "ISO 8601 start time" }
},
"required": ["datetime"]
}Checklist for a good tool
- Reads a standard, or hits your API — not a scraped selector.
- Returns
null/empty when data is missing; never fabricates. - Has a real
inputSchemawith descriptions. - Idempotent for reads; clearly side-effecting for writes (bookings, leads).
Need a live /api/mcp first? See the Cloudflare Worker guide, or let us build it.