Understand Path Patterns
Restrict a tool to specific pages on your site.
Why path patterns matter
If you register an addToCart tool on your site, it shouldn't appear when an AI agent visits your /contact page. Path patterns let you scope tools to where they make sense.
Setting a path pattern
In the tool form, the Page path field accepts a pattern. Leave it blank to show the tool on all pages.
Pattern syntax
| Pattern | Matches | Doesn't match |
|---|---|---|
| (blank) | All pages | — |
/contact | /contact exactly | /contact/us |
/products/* | /products/shoes | /products/shoes/detail |
/products/** | /products/shoes, /products/shoes/detail/blue | /other/shoes |
/blog/[slug] | /blog/hello-world | /blog/hello/extra |
*matches exactly one URL segment (no slashes)**matches any number of segments (including slashes)[param]is dynamic segment syntax — treated as a single-segment wildcard (same as*)
Real-world examples
E-commerce product page:
/products/*
Matches /products/shoes-01, /products/jacket-blue — one product per URL.
Blog section:
/blog/**
Matches /blog, /blog/2026/my-post, /blog/category/tech/post — any depth.
Exact contact page:
/contact
Only matches /contact — not /contact-us or /contact/form.
How the snippet uses path patterns
The snippet passes window.location.pathname to the config endpoint on every load:
GET /api/sites/YOUR_ID/config?path=/products/shoes-01
The server returns only tools whose pattern matches that path (or tools with no pattern).
Verifying your pattern
Use the config endpoint directly to check which tools are returned for a given path:
https://yourdomain.com/api/sites/YOUR_PUBLIC_ID/config?path=/products/test
Check the tools array in the response.