Documentation Index
Fetch the complete documentation index at: https://docs.closient.com/llms.txt
Use this file to discover all available pages before exploring further.
This page is the authoritative reference for the tools the Closient
MCP server registers via tools/list. Every tool described here is
a thin wrapper around the same service-layer functions used by the
REST API — if a call would succeed via the REST API for the
authenticated principal, it succeeds via MCP, and vice versa.
For installation see Install the MCP Server.
For error semantics see MCP Error Contract.
Conventions
- GTIN inputs accept GTIN-8, GTIN-12, GTIN-13, or GTIN-14 with or
without leading zeros. Closient normalizes everything to GTIN-14
internally — the normalized form is echoed back in the response.
- Optional fields in the input schema default to
None/null
and are omitted from the resulting query when not supplied.
- Errors are returned as JSON-RPC error objects with an
RFC 9457 Problem Details payload in
data. See
MCP Error Contract for the code table.
- Tool annotations (
readOnlyHint, idempotentHint, etc.) are
documented separately in
MCP Tool Annotations.
ping
Health probe. Returns the string "pong". Useful from an agent
preamble to verify the MCP connection is live before issuing real
calls.
Input: no arguments.
Output: string — always "pong".
Auth: none.
Example:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": { "name": "ping", "arguments": {} }
}
{
"jsonrpc": "2.0",
"id": 1,
"result": { "content": [ { "type": "text", "text": "pong" } ] }
}
validate_gtin
Pure GTIN validation — check digit, length, format. No catalog
lookup, no auth.
| Field | Type | Required | Description |
|---|
gtin | string | yes | A GTIN-8/12/13/14 string. Leading zeros are accepted but not required. |
Output:
| Field | Type | Description |
|---|
valid | boolean | Overall validity. |
error | string | null | Human-readable reason if invalid. |
normalized | string | null | Zero-padded GTIN-14 if valid. |
length | integer | Original GTIN length (before normalization). |
Example:
{
"name": "validate_gtin",
"arguments": { "gtin": "614141123452" }
}
{
"valid": true,
"error": null,
"normalized": "00614141123452",
"length": 12
}
resolve_gtin
Apply the GS1 Digital Link resolver-rule hierarchy
and return the destination the resolver would redirect to for a given
GTIN. Use this to learn what page (or external URL) a brand has
configured for a product without actually following the redirect.
| Field | Type | Required | Description |
|---|
gtin | string | yes | A valid GTIN. |
link_type | string | no | GS1 link-type CURIE such as gs1:pip or gs1:recallStatus. When omitted, the default link-type rule wins. |
Output:
| Field | Type | Description |
|---|
destination_url | string | Where the resolver would redirect. |
destination_type | string | HOSTED_PAGE or CUSTOM_URL. |
fallback_applied | boolean | true when no rule matched and the default was used. |
product_found | boolean | Whether a Product row exists for the GTIN. |
matched_rule_scope | string | null | PRODUCT, BRAND, ORGANIZATION, GLOBAL, or null. |
Example:
{
"name": "resolve_gtin",
"arguments": { "gtin": "00614141123452", "link_type": "gs1:pip" }
}
{
"destination_url": "https://www.closient.com/01/00614141123452",
"destination_type": "HOSTED_PAGE",
"fallback_applied": false,
"product_found": true,
"matched_rule_scope": "PRODUCT"
}
lookup_product
Look up the structured catalog record for a GTIN. Returns
found: false (rather than an error) when the GTIN is unknown so
agents can branch on the boolean without try/except plumbing.
| Field | Type | Required | Description |
|---|
gtin | string | yes | A valid GTIN. |
Output:
| Field | Type | Description |
|---|
found | boolean | Whether the GTIN is in the catalog. |
gtin | string | null | Normalized GTIN-14 if found. |
name | string | null | Product name. |
brand | string | null | Brand name. |
description | string | null | Product description. |
data_source | string | null | Origin of the record (manual, off, etc.). |
metadata | object | Flat string-to-string developer metadata. {} when unset. |
Example:
{ "name": "lookup_product", "arguments": { "gtin": "00614141123452" } }
{
"found": true,
"gtin": "00614141123452",
"name": "Sample Cereal",
"brand": "Acme Foods",
"description": "Whole-grain breakfast cereal.",
"data_source": "manual",
"metadata": { "internal_sku": "ACM-1234" }
}
search_products
Natural-language search across the Closient catalog. Combines
pgvector semantic search with PostgreSQL full-text lexical search
and (optionally) PostGIS-based geographic boosting.
| Field | Type | Required | Description |
|---|
query | string | yes | Free-text search string. Example: "organic oat milk". |
filters | object | no | Flat {key: value} dict applied to structured metadata. Useful keys: brand, category_id, country_of_origin. |
geo_lat | number | no | Latitude (WGS84) — requires geo_lng. |
geo_lng | number | no | Longitude (WGS84). |
limit | integer | no | Max results. Defaults to 20. |
When both geo_lat and geo_lng are present, results within 50 km
are boosted by proximity.
Output:
| Field | Type | Description |
|---|
items | array | Ordered by relevance (highest score first). Each item has gtin, brand, category, net_content, country_of_origin, price_min, price_max, score, distance_km. |
total | integer | Number of items returned. |
query | string | Echo of the input query. |
Example:
{
"name": "search_products",
"arguments": {
"query": "gluten-free pasta",
"geo_lat": 40.7128,
"geo_lng": -74.0060,
"limit": 5
}
}
get_product_detail
Comprehensive product record — attributes, images, ingredients,
nutrition facts. Use after search_products (or whenever a GTIN is
already in hand) to fetch everything in one round-trip.
| Field | Type | Required | Description |
|---|
gtin | string | yes | A valid GTIN. |
Output:
| Field | Type | Description |
|---|
found | boolean | false for unknown GTINs; other fields are then null/empty. |
product | object | null | Compact summary (gtin, name, brand, category, description, image_url, net_content, country_of_origin). |
images | array | {url, title, description, priority, is_primary} rows ordered by priority then creation time. |
ingredients | array | {name, percentage_of_weight, priority} rows. |
nutrition | object | null | {serving_size, servings_per_container, label_format, nutrients: [{name, amount, unit, daily_value_pct}, ...]} or null. |
hosted_page_url | string | The canonical hosted-page path (/01/{gtin14}). |
compare_products
Side-by-side comparison of 2-5 products by GTIN. Unknown GTINs
appear as found: false columns rather than raising — partial
comparisons are useful.
| Field | Type | Required | Description |
|---|
gtins | array<string> | yes | 2-5 GTINs. Order is preserved in the response. |
Output:
| Field | Type | Description |
|---|
items | array | One column per requested GTIN — {found, gtin, product}. |
attributes | array | Aligned attribute rows — {name, values} where values[i] corresponds to items[i]. Currently: brand, category, net_content, country_of_origin, price_min, price_max. |
Example:
{
"name": "compare_products",
"arguments": { "gtins": ["00614141123452", "00614141999999"] }
}
check_availability
Find nearby physical stores carrying a specific product. Returns
active in-store offers within radius_km, ordered by ascending
distance. When no offers exist for the product, the response is
structurally well-formed (empty locations) rather than an error
so agents can confidently say “no nearby availability” without
exception handling.
| Field | Type | Required | Description |
|---|
gtin | string | yes | A valid GTIN. |
lat | number | yes | Latitude (WGS84) of the search origin. |
lng | number | yes | Longitude (WGS84). |
radius_km | number | no | Maximum search radius in km. Defaults to 25. |
Output:
| Field | Type | Description |
|---|
gtin | string | Normalized GTIN-14 echoed for convenience. |
radius_km | number | Echo of the search radius. |
locations | array | {retailer, store_name, address, city, region, postal_code, distance_km, price, currency, inventory_status} rows. |
total | integer | Number of locations returned (may be 0). |
generate_qr_url
Build the canonical GS1 Digital Link
URL for a GTIN, optionally with batch/lot and serial qualifiers. The
returned URL is what should be encoded into a 2D barcode (QR or Data
Matrix). When scanned, the URL hits Closient’s resolver at
/01/{gtin14}[/10/{batch}][/21/{serial}] and returns the linkset or
redirects to the destination per the resolver rules.
| Field | Type | Required | Description |
|---|
gtin | string | yes | A valid GTIN — normalized to GTIN-14 in the URL. |
batch | string | no | Batch / lot identifier (GS1 AI 10). |
serial | string | no | Unique serial (GS1 AI 21). |
Output:
| Field | Type | Description |
|---|
qr_url | string | The canonical Digital Link URL. |
gtin14 | string | Normalized GTIN-14 used in the URL. |
host | string | Host portion of the URL (from SITE_URL). |
Auth: OAuth 2.0 bearer token with qr:generate scope. See
Authentication. Anonymous calls and
calls with a token that doesn’t include qr:generate return JSON-RPC
error code -32002 (forbidden).
Example:
{
"name": "generate_qr_url",
"arguments": {
"gtin": "00614141123452",
"batch": "LOT-A1",
"serial": "SN-0001"
}
}
{
"qr_url": "https://www.closient.com/01/00614141123452/10/LOT-A1/21/SN-0001",
"gtin14": "00614141123452",
"host": "www.closient.com"
}
See also