Get Promotion Details (Messaging)
messagingmcp-get_promo
Fetch a single promotion by promo_id — the campaign detail / drill-down view.
The representative capture is the most recent one (or the most recent at or
before as_of). Provenance comes at two levels: any_inferred (campaign —
does any backing row come from forward-projection?) and
representative_inferred (row — does this specific view rest on a projected
capture?); n_observed counts the distinct observed captures (same-day
re-shoots count separately). All are scoped to <= as_of when given.
Unlike list/search, the response includes promo_active_dates — the literal
active sub-ranges (half-open {gte, lt}), gaps visible — so use this tool to
answer "has this promotion run continuously?".
Parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
promo_id | string | yes | — | The promo_id to fetch (as returned by list_promos / search_promo_text). |
as_of | string | null | no | default: null | Optional point-in-time view (YYYY-MM-DD). Returns the promotion as it stood on or before this date — the latest capture whose date is <= as_of. |
Returns
- On success: {"promo": PromoHit}.
- When the promo_id is unknown (or has no capture at/before as_of): {"promo": null}.
- On failure: {"error": str}.
Try it
Loading interactive widget…
Code examples
- curl
- TypeScript
- Python
curl -s https://mcp.edited.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-H "x-api-key: $MCP_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "messagingmcp-get_promo",
"arguments": {
"promo_id": "example",
"as_of": null
}
}
}'
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "demo", version: "1.0.0" }, { capabilities: {} });
await client.connect(
new StreamableHTTPClientTransport(new URL("https://mcp.edited.com/mcp"), {
requestInit: { headers: { "x-api-key": process.env.MCP_API_KEY ?? "" } },
}),
);
const result = await client.callTool({
name: "messagingmcp-get_promo",
arguments: {
"promo_id": "example",
"as_of": null
},
});
import os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
headers = {"x-api-key": os.environ["MCP_API_KEY"]}
async with streamablehttp_client("https://mcp.edited.com/mcp", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
result = await session.call_tool(
"messagingmcp-get_promo",
{"promo_id": "example", "as_of": None},
)
Input schema
{
"type": "object",
"properties": {
"promo_id": {
"description": "The promo_id to fetch (as returned by list_promos / search_promo_text).",
"type": "string"
},
"as_of": {
"anyOf": [
{
"format": "date",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional point-in-time view (YYYY-MM-DD). Returns the promotion as it stood on or before this date — the latest capture whose date is <= as_of."
}
},
"required": [
"promo_id"
]
}