Discovery Tool
get_policies
Search store policies using semantic matching. Returns the most relevant policy snippets for a given question.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | — | Natural language question about store policies. Examples: "What is your return policy?", "How long does shipping take?" | |
limit | integer | 5 | Number of policy snippets to return. Range: 1-10. |
Semantic search
The query parameter uses semantic search, not keyword matching. Ask natural questions like "Can I return opened items?" rather than searching for exact phrases.
Response
Returns an array of policy objects ranked by semantic relevance. Returns an empty array if no policies are found or the store has not configured any policies.
Response
[
{
"name": "Return Policy",
"path": "/policies/refund-policy",
"content": "We accept returns within 30 days of purchase for a full refund. Items must be unused, in original packaging, and accompanied by a receipt. To initiate a return, email support@coolcoffee.com with your order number.",
"relevance_score": 0.94,
"chunk_info": null
},
{
"name": "Shipping Policy",
"path": "/policies/shipping-policy",
"content": "Free standard shipping on all orders over $50. Standard shipping takes 5-7 business days. Express shipping (2-3 business days) is available for $9.99. We ship to all 50 US states.",
"relevance_score": 0.72,
"chunk_info": "Part 1 of 2"
}
]Example
Example Call
// Tool call
{
"name": "get_policies",
"arguments": {
"query": "What is your return policy?",
"limit": 3
}
}Response Fields
| Field | Type | Description |
|---|---|---|
name | string | The policy name (e.g. "Return Policy", "Shipping Policy"). |
path | string | URL path or identifier for this policy on the store's website. |
content | string | The relevant policy content or snippet matching the search query. |
relevance_score | number | Semantic relevance score from 0 to 1. Higher values indicate a better match to the query. |
chunk_info | string | null | For long policies that are split into chunks, indicates which part this is (e.g. "Part 2 of 5"). Null for short policies that fit in a single chunk. |
Notes
- Policies are indexed from the store's Shopify policy pages (return, shipping, privacy, terms of service, etc.).
- Long policies are automatically chunked. When
chunk_infois present, it indicates the result is a portion of a larger policy. Multiple chunks from the same policy may appear in results. - Results are ranked by semantic similarity. A high
relevance_score(above 0.8) indicates a strong match to the query. - An empty array is returned if the store has no indexed policies.