On this page
To automate AI agent media delivery safely through the Model Context Protocol, chain TrolyPage’s /mcp/assets server (13 tools) with /mcp/agents (54 tools). Validate workspace limits with AssetUploadPoliciesTool, ingest images via resumable multipart or HTTPS import with idempotency_key receipts, bind the managed asset URL to a prompt variable using BindAgentMediaTool, and run pre-live checks via RunAgentConversationTool and VerifyAgentOutcomeTool.
Editorial disclosure: Published by TrolyPage, whose 291-tool MCP Gateway is examined in this engineering guide. All protocol mechanics, payload limits, and governance behaviors are cross-checked against live platform endpoints, workspace tool implementations, and primary external specifications.
Why Hardcoding Media URLs and Ad-Hoc Uploads Break AI Support Agents
Teams often paste a CDN link directly into a system prompt or drop a brochure into a knowledge base and assume the AI assistant will deliver it reliably. Across live Messenger, WhatsApp, Zalo, and Website Chat traffic, three failure modes expose that shortcut:
- External link rot and hotlink blocks: Third-party CDN URLs expire or reject automated channel fetches, forcing manual prompt edits whenever creatives rotate.
- The 64 KiB approval-queue ceiling: On TrolyPage’s 291-tool MCP Gateway,
UploadAssetToolaccepts up to 6 MiB decoded base64. However, instrictorhybridgovernance modes,McpPolicyGuardqueues mutating tool calls for human sign-off and rejects serialized arguments above 65,536 bytes (64 KiB). Any base64 upload above ~48 KiB hits that wall unless you use resumable multipart transfers. - The scanned-PDF non-OCR trap: TrolyPage parses embedded PDF text layers only, with no OCR pipeline for image-only scanned PDFs. Exporting scanned rate cards as PNG or WebP images lets vision models read them and enables
image_sendingpreviews.
TrolyPage exposes 1 unified server (https://trolypage.com/mcp/troly, 291 tools / 14 resources) and 11 domain servers: support (19), commerce (40), analytics (16), social (56), marketing (38), knowledge (14), workspace (30), agents (54), assets (13), automation (21), plus editorial blog. Note that trolypage.com/pricing still shows legacy copy citing 86 tools across 7 business servers, whereas /mcp reflects the live 291-tool catalog. Also note an integration boundary: an internal v1 REST API exists in the codebase, but TrolyPage’s Public Developer REST API is still in progress; production automation relies on Outbound/Inbound Webhooks, Zapier Webhooks, and MCP.

Tradeoff Analysis: Hardcoded URLs vs. Ad-Hoc Uploads vs. Governed MCP Pipeline
The matrix below compares Option A, Option B, and Option C across payload limits, concurrency guards, and failure costs.
| Dimension | Option A: Hardcoded URLs | Option B: Ad-Hoc Uploads | Option C: Governed /mcp/assets + /mcp/agents |
Root Mechanism & Failure Cost |
|---|---|---|---|---|
| Link Ownership | External CDN controls TTL and CORS; no asset_id. |
In library, referenced inconsistently. | Managed HTTPS URL from UploadAssetTool, ImportAssetTool, or CompleteAssetUploadTool. |
BindAgentMediaTool enforces type === 'image' and https://; broken external links cause silent conversion loss. |
| Payload Thresholds | Fails if channel crawlers block hotlinks. | Manual UI only; no checksum validation. | Base64 ≤ 6 MiB (auto only); approval cap 64 KiB; HTTPS import ≤ 100 MiB; multipart ≤ 2 GiB (10 parts/call). |
Payloads > 64 KiB fail strict/hybrid queues; multipart leases avoid timeout retries. |
| Retry Safety | Repeated prompt edits overwrite blindly. | Duplicate uploads burn storage quota. | idempotency_key + mcp_operation_receipts hashes args and returns HTTP 409 executing_or_unknown. |
Eliminates duplicate assets and race conditions on network drops. |
| Prompt Blast Radius | Creative rotation requires editing prompt prose. | Manual URL pasting risks syntax typos. | {{variable_key}} indirection plus SaveAgentPromptVersionTool snapshots. |
One BindAgentMediaTool call swaps creatives with zero prompt drift. |
| Pre-Live QA & Hygiene | No C2PA check; no outcome preflight. | Missing image_sending flags caught late. |
DetectAssetC2paTool + CleanAssetImageTool, then RunAgentConversationTool + VerifyAgentOutcomeTool. |
Catches disabled tools and broken directives before live traffic arrives. |
Stage 1: Asset Ingestion, Multipart Leases, and C2PA Hygiene on /mcp/assets
Per the MCP Tools specification, start with read-only discovery before mutating state. Call AssetUploadPoliciesTool (IsReadOnly) to inspect permitted MIME types, byte limits, and storage quota. Local client paths are never readable by the remote MCP server, so choose one of three transfer routes:
- Public HTTPS Pull (
ImportAssetTool): Pulls publichttps://media up to 100 MiB throughHardenedRemoteMediaDownloader, returning a readyasset_idand URL. - Small Inline Base64 (
UploadAssetTool): Accepts up to 6 MiB decoded (8,388,608 base64 chars) only inautomode;strict/hybridapproval queues reject arguments above 65,536 bytes (64 KiB). - Resumable Multipart Lease (
PrepareAssetUploadTool→CompleteAssetUploadTool): Following S3-style multipart upload, this scales to 2 GiB while keeping MCP arguments tiny. CallPrepareAssetUploadTool(UUIDidempotency_key,checksum_sha256,size_bytes,purpose: "social_media"), lock withLeaseAssetUploadTool(client UUIDtoken), fetch up to 10 signed PUT URLs per call viaAssetUploadPartUrlsTool(X-Upload-Lease), upload bytes directly, callCompleteAssetUploadTool, and pollGetAssetUploadTooluntilready(or abort viaCancelAssetUploadTool).
Mirroring Stripe’s idempotent requests, McpOperationReceipts claims idempotency_key and arguments_hash in mcp_operation_receipts before execution. Ambiguous retries return HTTP 409 executing_or_unknown instead of duplicating uploads. Next, check C2PA Content Credentials via DetectAssetC2paTool (IsReadOnly heuristic marker scan—not cryptographic signature validation or SynthID proof). To sanitize metadata, CleanAssetImageTool runs strip-c2pa (preserving ICC profiles via Imagick) or clear-synthid (best-effort pixel transform without guaranteed watermark removal), always preserving the original asset and returning a new asset_id.

Stage 2: Binding Media Variables and Snapshotting Prompts on /mcp/agents
With a verified asset_id in hand, hand off execution to TrolyPage’s /mcp/agents server (54 tools). Rather than rewriting prompt prose every time a seasonal banner or shipping chart changes, separate text instructions from asset references through two variable primitives:
- Scalar state via
CreateAgentVariableTool&UpdateAgentVariableTool: Store structured text values such as cutoff hours, promo codes, or warranty disclaimers after inspecting current IDs withListAgentsToolandInspectAgentTool. - Managed media binding via
BindAgentMediaTool: Passagent_id,asset_id, and avariable_keymatching/^[A-Za-z_][A-Za-z0-9_]*$/. The server enforces that the referenced asset is a processedimagewith a publichttps://URL, upserts the variable, and returns four critical fields:prompt_reference(e.g.,{{q4_rate_card}}),image_directive([ACTION:SEND_IMAGE url="{{q4_rate_card}}"]),image_capability_enabled(a live boolean checking whether the agent’simage_sendingtool is active), anddelivery_verified: false.
Before modifying an agent’s core prompt to reference that directive, call SaveAgentPromptVersionTool. Snapshotting a named version guarantees instant rollback via RestoreAgentPromptVersionTool if tone or tool-calling accuracy regresses. You can also inspect safety rules with UpdateAgentSafetyTool (bearing in mind Data Safety PII masking applies to configured rules and does not retroactively purge historical conversation logs) and check overall deployment readiness with AgentReadinessTool.
| Pipeline Stage & Tool | Server | MCP Annotation | Key Guards & Limits | Governance Mode Behavior |
|---|---|---|---|---|
AssetUploadPoliciesTool |
/mcp/assets |
IsReadOnly |
Returns MIME allowlist, size caps, storage quota; no side effects. | Executes immediately in strict, hybrid, and auto. |
PrepareAssetUploadTool & LeaseAssetUploadTool |
/mcp/assets |
IsDestructive |
UUID idempotency_key + checksum_sha256; max 2 GiB; lease token UUID. |
Queued in strict/hybrid (tiny JSON args easily stay under 64 KiB); auto-runs in auto. |
UploadAssetTool |
/mcp/assets |
IsDestructive |
Base64 max 6 MiB decoded; rejects local paths; idempotency_key required. |
Fails above 65,536 bytes in strict/hybrid approval queues; use multipart instead. |
DetectAssetC2paTool |
/mcp/assets |
IsReadOnly |
Heuristic marker scan only; non-mutating; requires workspace asset_id. |
Executes immediately across all modes (requires read or write token). |
CleanAssetImageTool |
/mcp/assets |
IsDestructive |
strip-c2pa or clear-synthid; creates new asset_id; original kept. |
Gated by McpPolicyGuard; returns before/after scan metadata. |
BindAgentMediaTool |
/mcp/agents |
IsDestructive |
Enforces image + https://; regex-safe variable_key; checks image_sending. |
Gated by McpPolicyGuard; outputs [ACTION:SEND_IMAGE] directive. |
SaveAgentPromptVersionTool |
/mcp/agents |
IsDestructive |
Snapshots prompt state before core edits; does not activate agent. | Gated by McpPolicyGuard; pairs with RestoreAgentPromptVersionTool. |
RunAgentConversationTool |
/mcp/agents |
IsDestructive + IsOpenWorld |
Runs live runtime (not a sandbox); consumes AI tokens; delivery_verified: false. |
Must target a dedicated test subscriber to avoid real order side effects. |
VerifyAgentOutcomeTool |
/mcp/agents |
IsDestructive |
Contract preflight per outcome_id; live_delivery_verified: false. |
Records diagnostic probes; precedes manual channel smoke test. |
Stage 3: Pre-Live Runtime Checks, Workspace Observability, and Operational Boundaries
Once BindAgentMediaTool confirms image_capability_enabled: true and your updated prompt version is saved, verify runtime behavior before flipping ActivateAgentTool. Treat RunAgentConversationTool with strict operational discipline: it carries both IsDestructive and IsOpenWorld annotations because it executes through the actual agent runtime, not an isolated sandbox. Every test turn consumes plan AI token quota, writes conversation history, and can fire enabled business tools. Always bind a dedicated internal test subscriber and prompt explicitly without triggering live order creation.
Follow the conversation test with VerifyAgentOutcomeTool to run business-outcome contract preflight against your target outcome_id. Notice the deliberate honesty built into both tool responses: RunAgentConversationTool returns delivery_verified: false and VerifyAgentOutcomeTool returns live_delivery_verified: false. Neither tool mocks Meta Messenger, WhatsApp Cloud API, or Zalo OA webhook roundtrips—so your final release gate must be a one-minute smoke test on a private test Page or chat thread before live customer traffic resumes. This complements the multi-platform drafting pattern demonstrated in TrolyPage’s ChatGPT MCP social ops guide.
For ongoing observability across teams, pair the media pipeline with /mcp/workspace (30 tools) and /mcp/support (19 tools). Operators can audit queued approvals via ListMcpActionsTool, inspect webhook delivery logs via ListIntegrationEventsTool and ListIntegrationActionExecutionsTool, retry failed deliveries with ReplayIntegrationDeliveryTool, acknowledge alerts with AckNotificationTool / ResolveNotificationTool, or dispatch ops alerts to Telegram via SendTelegramNotificationTool. Automatic secret redaction protects credentials in logs and responses.
Teams planning budget and architecture around TrolyPage should also factor in documented product boundaries alongside capabilities listed on trolypage.com/features:
- Plan tiers and connection math: Free is a one-time time-limited trial (10 auto-posts/month with no links, not a permanent free tier). Paid plans run from Lite ($8/month) and Starter ($16/month) to Pro ($32/month) and Scale ($104/month), with flexible add-ons at $1/month per extra seat and $2/month per extra Page (by default, 1 Facebook Page using both publishing and Messenger consumes 2 service connections).
- Integration and channel scope: TrolyPage has no native two-way Shopify, WooCommerce, BigCommerce, HubSpot, or Salesforce admin sync—use Outbound/Inbound Webhooks, Zapier Webhooks, or MCP instead. Slack supports outbound notifications only (no two-way customer inbox).
- Support and documentation locale: Automated AI runs 24/7, while live vendor staff support operates during Vietnam business hours (
UTC+7). Official reference pages on docs.trolypage.com are currently published in Vietnamese.
Copy-Paste Operational Assets: Scoped MCP Config and Pre-Live QA Runbook
First, separate client transport config from model-level tool filtering rather than exposing all 291 tools on /mcp/troly. For VS Code (.vscode/mcp.json), declare prompt-based secrets under inputs and endpoints under servers (portable .mcp.json clients such as Claude Code and Cursor use mcpServers with environment variables and optional tools allowlists instead of inputs):
{
"inputs": [
{
"id": "troly_mcp_readonly_token",
"type": "promptString",
"description": "TrolyPage MCP token (mcp:read only)",
"password": true
},
{
"id": "troly_mcp_write_token",
"type": "promptString",
"description": "TrolyPage MCP token (mcp:write scoped to assets and agents)",
"password": true
}
],
"servers": {
"trolypage_media_readonly": {
"type": "http",
"url": "https://trolypage.com/mcp/assets",
"headers": { "Authorization": "Bearer ${input:troly_mcp_readonly_token}" }
},
"trolypage_assets_write": {
"type": "http",
"url": "https://trolypage.com/mcp/assets",
"headers": { "Authorization": "Bearer ${input:troly_mcp_write_token}" }
},
"trolypage_agents_qa": {
"type": "http",
"url": "https://trolypage.com/mcp/agents",
"headers": { "Authorization": "Bearer ${input:troly_mcp_write_token}" }
}
}
}
When calling TrolyPage from the OpenAI Responses API, pass allowed_tools and require_approval inside the API tools array instead of inside .mcp.json:
{
"tools": [
{
"type": "mcp",
"server_label": "trolypage_media_readonly",
"server_url": "https://trolypage.com/mcp/assets",
"headers": { "Authorization": "Bearer $TROLY_MCP_READONLY_TOKEN" },
"allowed_tools": ["asset-upload-policies", "search-assets", "get-asset-upload", "detect-asset-c2pa"],
"require_approval": "never"
},
{
"type": "mcp",
"server_label": "trolypage_assets_write",
"server_url": "https://trolypage.com/mcp/assets",
"headers": { "Authorization": "Bearer $TROLY_MCP_WRITE_TOKEN" },
"allowed_tools": [
"prepare-asset-upload", "lease-asset-upload", "asset-upload-part-urls",
"complete-asset-upload", "import-asset", "clean-asset-image"
],
"require_approval": "always"
},
{
"type": "mcp",
"server_label": "trolypage_agents_qa",
"server_url": "https://trolypage.com/mcp/agents",
"headers": { "Authorization": "Bearer $TROLY_MCP_WRITE_TOKEN" },
"allowed_tools": [
"inspect-agent", "save-agent-prompt-version", "create-agent-variable",
"update-agent-variable", "bind-agent-media", "run-agent-conversation", "verify-agent-outcome"
],
"require_approval": {
"never": ["inspect-agent"],
"always": ["save-agent-prompt-version", "bind-agent-media", "run-agent-conversation", "verify-agent-outcome"]
}
}
]
}
Second, run this 7-step ingestion, lease, binding, and pre-live QA sequence, plus an Outbound Webhook notification payload once VerifyAgentOutcomeTool passes:
# 1. Check MIME & quota -> 2. Prepare resumable upload (safe under 64 KiB cap)
call asset-upload-policies {}
call prepare-asset-upload {
"idempotency_key": "8f3c2d10-4b7a-4e21-9c12-104b9f2aa91d",
"file_name": "q4-rate-card.webp", "content_type": "image/webp",
"size_bytes": 412800, "checksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "purpose": "social_media"
}
# 3. Acquire lease UUID -> 4. Fetch part URLs (max 10/call), PUT bytes, complete & poll
call lease-asset-upload { "upload_id": "2c8e14b0-9f41-4c22-8b3d-19a4f6e20011", "token": "6d91a044-2c1e-4a99-8d11-77e1b2c90011" }
call asset-upload-part-urls { "upload_id": "2c8e14b0-9f41-4c22-8b3d-19a4f6e20011", "part_numbers": [1], "upload_lease": "6d91a044-2c1e-4a99-8d11-77e1b2c90011" }
call complete-asset-upload { "upload_id": "2c8e14b0-9f41-4c22-8b3d-19a4f6e20011", "upload_lease": "6d91a044-2c1e-4a99-8d11-77e1b2c90011" }
call get-asset-upload { "upload_id": "2c8e14b0-9f41-4c22-8b3d-19a4f6e20011" }
# 5. Scan & strip C2PA (returns new asset_id; original preserved)
call detect-asset-c2pa { "asset_id": 4821 }
call clean-asset-image { "asset_id": 4821, "action": "strip-c2pa", "idempotency_key": "c9a12044-91b2-4e11-8891-3f22d1e40912" }
# 6. Snapshot prompt & bind managed HTTPS variable -> 7. Runtime & contract preflight
call save-agent-prompt-version { "agent_id": 14, "label": "pre-q4-rate-card", "system_prompt": "You are TrolyPage support. Answer shipping fee questions clearly and send [ACTION:SEND_IMAGE url=\"{{q4_rate_card_img}}\"] when requested." }
call bind-agent-media { "agent_id": 14, "asset_id": 4822, "variable_key": "q4_rate_card_img" }
call run-agent-conversation { "agent_id": 14, "subscriber_id": "990012", "message": "Send the Q4 rate card image." }
call verify-agent-outcome { "agent_id": 14, "outcome_id": "send_rate_card" }
{
"event": "mcp.agent_media.qa_passed",
"agent_id": 14,
"asset_id": 4822,
"variable_key": "q4_rate_card_img",
"image_capability_enabled": true,
"live_delivery_verified": false,
"next_action": "Run 1-turn live channel smoke test before ActivateAgentTool"
}
Comments
Your comment will appear after review.
Sign in to commentNo comments to show.