Every MCP tool with access, arguments and examples.
An agent only sees the tools its connection allows. Read tools need read access and write tools need write access. Write tools can only change ads that the same connection created. Tool problems come back with isError set to true and a message the agent can act on.
All tools
| Tool | Access | What it does |
|---|---|---|
get_account | Read | Company, connection access, limits and the portal link. |
list_placements | Read | Pages that sell ads with formats, prices per day, duration discounts, booking rules and recent traffic. |
check_availability | Read | Booked date ranges for one placement. |
get_quote | Read | Price and availability for a plan. |
list_ads | Read | Ads on the account with status, dates, totals, views and clicks. |
get_ad | Read | One ad with its creative, history, review reasons and payments. |
get_overview | Read | Counts by status, views and clicks for 30 days and total spend. |
get_report | Read | Full report for one ad or all ads. |
upload_image | Write | Upload a PNG, JPEG or WebP sent as base64. |
import_media | Write | Fetch an image, video or poster from a public https link. |
create_upload_link | Write | One time link to POST a file in the multipart field file. |
create_ad | Write | Create an ad that holds its dates while it waits for payment. |
update_ad | Write | Change the plan and creative of an unpaid ad this connection created. |
edit_ad_creative | Write | Change the creative while the ad is unpaid or in review. |
checkout_ad | Write | Payment link for an unpaid ad this connection created. |
cancel_ad | Write | Cancel an unpaid ad this connection created and free its dates. |
get_account
Read Company, connection access, limits and the portal link.
No arguments.
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_account", "arguments": {}}}' result = await session.call_tool(
"get_account",
{},
)
print(result.structuredContent)const result = await client.callTool({
name: "get_account",
arguments: {},
});
console.log(result.structuredContent);list_placements
Read Pages that sell ads with formats, prices per day, duration discounts, booking rules and recent traffic.
No arguments.
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "list_placements", "arguments": {}}}' result = await session.call_tool(
"list_placements",
{},
)
print(result.structuredContent)const result = await client.callTool({
name: "list_placements",
arguments: {},
});
console.log(result.structuredContent);check_availability
Read Booked date ranges for one placement.
| Argument | Type | Required | Description |
|---|---|---|---|
page_id | uuid | Yes | Placement id from list_placements |
from | date | Yes | First day to check |
to | date | Yes | Last day to check |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "check_availability", "arguments": {"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10", "from": "2026-12-01", "to": "2026-12-31"}}}' result = await session.call_tool(
"check_availability",
{
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"from": "2026-12-01",
"to": "2026-12-31"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "check_availability",
arguments: {
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"from": "2026-12-01",
"to": "2026-12-31"
},
});
console.log(result.structuredContent);get_quote
Read Price and availability for a plan.
| Argument | Type | Required | Description |
|---|---|---|---|
page_id | uuid | Yes | Placement id |
format | string | Yes | image or video |
days | integer | Yes | 1 to 365 |
start_date | date | Yes | From tomorrow |
coupon | string | No | Coupon code |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_quote", "arguments": {"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10", "format": "video", "days": 30, "start_date": "2026-12-01"}}}' result = await session.call_tool(
"get_quote",
{
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "video",
"days": 30,
"start_date": "2026-12-01"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "get_quote",
arguments: {
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "video",
"days": 30,
"start_date": "2026-12-01"
},
});
console.log(result.structuredContent);list_ads
Read Ads on the account with status, dates, totals, views and clicks.
| Argument | Type | Required | Description |
|---|---|---|---|
limit | integer | No | 1 to 50 |
offset | integer | No | For paging |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "list_ads", "arguments": {"limit": 10}}}' result = await session.call_tool(
"list_ads",
{
"limit": 10
},
)
print(result.structuredContent)const result = await client.callTool({
name: "list_ads",
arguments: {
"limit": 10
},
});
console.log(result.structuredContent);get_ad
Read One ad with its creative, history, review reasons and payments.
| Argument | Type | Required | Description |
|---|---|---|---|
ad_id | uuid | Yes | Ad id |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_ad", "arguments": {"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"}}}' result = await session.call_tool(
"get_ad",
{
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "get_ad",
arguments: {
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"
},
});
console.log(result.structuredContent);get_overview
Read Counts by status, views and clicks for 30 days and total spend.
No arguments.
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_overview", "arguments": {}}}' result = await session.call_tool(
"get_overview",
{},
)
print(result.structuredContent)const result = await client.callTool({
name: "get_overview",
arguments: {},
});
console.log(result.structuredContent);get_report
Read Full report for one ad or all ads.
| Argument | Type | Required | Description |
|---|---|---|---|
ad_id | uuid | No | Leave out for all ads |
period | string | No | day, week or month |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_report", "arguments": {"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b", "period": "day"}}}' result = await session.call_tool(
"get_report",
{
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b",
"period": "day"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "get_report",
arguments: {
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b",
"period": "day"
},
});
console.log(result.structuredContent);upload_image
Write Upload a PNG, JPEG or WebP sent as base64.
| Argument | Type | Required | Description |
|---|---|---|---|
kind | string | Yes | image or poster |
content_type | string | Yes | image/png, image/jpeg or image/webp |
data_base64 | string | Yes | File bytes, up to 5 MB |
filename | string | No | Original name |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "upload_image", "arguments": {"kind": "image", "content_type": "image/png", "data_base64": "iVBORw0KGgo..."}}}' result = await session.call_tool(
"upload_image",
{
"kind": "image",
"content_type": "image/png",
"data_base64": "iVBORw0KGgo..."
},
)
print(result.structuredContent)const result = await client.callTool({
name: "upload_image",
arguments: {
"kind": "image",
"content_type": "image/png",
"data_base64": "iVBORw0KGgo..."
},
});
console.log(result.structuredContent);import_media
Write Fetch an image, video or poster from a public https link.
| Argument | Type | Required | Description |
|---|---|---|---|
kind | string | Yes | image, video or poster |
url | string | Yes | Public https link |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "import_media", "arguments": {"kind": "image", "url": "https://cdn.nova.example/banner.png"}}}' result = await session.call_tool(
"import_media",
{
"kind": "image",
"url": "https://cdn.nova.example/banner.png"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "import_media",
arguments: {
"kind": "image",
"url": "https://cdn.nova.example/banner.png"
},
});
console.log(result.structuredContent);create_upload_link
Write One time link to POST a file in the multipart field file.
| Argument | Type | Required | Description |
|---|---|---|---|
kind | string | Yes | image, video or poster |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "create_upload_link", "arguments": {"kind": "video"}}}' result = await session.call_tool(
"create_upload_link",
{
"kind": "video"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "create_upload_link",
arguments: {
"kind": "video"
},
});
console.log(result.structuredContent);create_ad
Write Create an ad that holds its dates while it waits for payment.
| Argument | Type | Required | Description |
|---|---|---|---|
page_id | uuid | Yes | Placement id |
format | string | Yes | image or video |
days | integer | Yes | 1 to 365 |
start_date | date | Yes | From tomorrow |
coupon | string | No | Coupon code |
creative | object | Yes | Headline, link and media keys |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "create_ad", "arguments": {"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10", "format": "image", "days": 7, "start_date": "2026-12-01", "coupon": "WELCOME10", "creative": {"headline": "Record and cut in one app", "body": "Free for your first project.", "cta_label": "Try Nova", "destination_url": "https://nova.example/drefly", "image_key": "sponsor/users/4b1d.../9c1e.webp"}}}}' result = await session.call_tool(
"create_ad",
{
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "image",
"days": 7,
"start_date": "2026-12-01",
"coupon": "WELCOME10",
"creative": {
"headline": "Record and cut in one app",
"body": "Free for your first project.",
"cta_label": "Try Nova",
"destination_url": "https://nova.example/drefly",
"image_key": "sponsor/users/4b1d.../9c1e.webp"
}
},
)
print(result.structuredContent)const result = await client.callTool({
name: "create_ad",
arguments: {
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "image",
"days": 7,
"start_date": "2026-12-01",
"coupon": "WELCOME10",
"creative": {
"headline": "Record and cut in one app",
"body": "Free for your first project.",
"cta_label": "Try Nova",
"destination_url": "https://nova.example/drefly",
"image_key": "sponsor/users/4b1d.../9c1e.webp"
}
},
});
console.log(result.structuredContent);update_ad
Write Change the plan and creative of an unpaid ad this connection created.
| Argument | Type | Required | Description |
|---|---|---|---|
ad_id | uuid | Yes | Ad id |
| ... | Yes | The same fields as create_ad |
edit_ad_creative
Write Change the creative while the ad is unpaid or in review.
| Argument | Type | Required | Description |
|---|---|---|---|
ad_id | uuid | Yes | Ad id |
creative | object | Yes | Headline, link and media keys |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "edit_ad_creative", "arguments": {"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b", "creative": {"headline": "Cut videos faster", "destination_url": "https://nova.example/drefly"}}}}' result = await session.call_tool(
"edit_ad_creative",
{
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b",
"creative": {
"headline": "Cut videos faster",
"destination_url": "https://nova.example/drefly"
}
},
)
print(result.structuredContent)const result = await client.callTool({
name: "edit_ad_creative",
arguments: {
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b",
"creative": {
"headline": "Cut videos faster",
"destination_url": "https://nova.example/drefly"
}
},
});
console.log(result.structuredContent);checkout_ad
Write Payment link for an unpaid ad this connection created.
| Argument | Type | Required | Description |
|---|---|---|---|
ad_id | uuid | Yes | Ad id |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "checkout_ad", "arguments": {"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"}}}' result = await session.call_tool(
"checkout_ad",
{
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "checkout_ad",
arguments: {
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"
},
});
console.log(result.structuredContent);cancel_ad
Write Cancel an unpaid ad this connection created and free its dates.
| Argument | Type | Required | Description |
|---|---|---|---|
ad_id | uuid | Yes | Ad id |
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "cancel_ad", "arguments": {"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"}}}' result = await session.call_tool(
"cancel_ad",
{
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "cancel_ad",
arguments: {
"ad_id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b"
},
});
console.log(result.structuredContent);Next steps
Thanks for the feedback. Tell us what was missing