Response shapes
Search response
json
{
"data": [
{
"uid": "blt123",
"content_type": "blogpost",
"title": "Getting Started",
"url": "/blog/getting-started",
"description": "An introduction",
"locale": "en-us"
}
],
"meta": {
"total": 42,
"limit": 10,
"offset": 0,
"has_more": true
}
}Detail response
json
{
"data": {
"uid": "blt123",
"content_type": "blogpost",
"title": "Getting Started",
"url": "/blog/getting-started",
"markdown": "# Getting Started\n\nBody text…",
"locale": "en-us",
"references": {
"author": [{ "uid": "blt456", "title": "Tim" }]
}
}
}Content type list
json
{
"data": [
{
"uid": "blogpost",
"label": "Blog Post",
"url_field": "url",
"title_field": "title"
}
]
}Error response
json
{
"error": {
"code": "not_found",
"message": "No entry found for URL: /missing"
}
}Tool results
WebMCP execute handlers resolve to a plain serializable value — the shapes above are what the agent receives, unwrapped. There is no MCP content envelope; that belongs to MCP servers, not the browser API.
Errors resolve to an error object rather than rejecting:
typescript
{ error: { code: "tool_error", message: "…" } }Helpers:
typescript
import { toolError, safeExecute } from "@timbenniks/contentstack-webmcp";Serializers
Transform entries before returning:
typescript
import {
entryToSummary,
entryToDetail,
entryToMarkdown,
} from "@timbenniks/contentstack-webmcp/serializers";