Skip to content

Commit 1abd40d

Browse files
committed
refactor(get_ad_image): put account_id first in the signature
Matches the convention used elsewhere (most account-scoped tools list account_id first) and groups the account_id + image_hash mode arguments adjacently.
1 parent 7b5846b commit 1abd40d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎meta_ads_mcp/core/ads.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,26 +716,26 @@ async def get_ad_creatives(ad_id: str, access_token: Optional[str] = None) -> st
716716
@mcp_server.tool()
717717
@meta_api_tool
718718
async def get_ad_image(
719+
account_id: Optional[str] = None,
719720
ad_id: Optional[str] = None,
720721
image_hash: Optional[str] = None,
721-
account_id: Optional[str] = None,
722722
access_token: Optional[str] = None,
723723
) -> Image:
724724
"""
725725
Get, download, and visualize a Meta ad image in one step. Useful to see the image in the LLM.
726726
727727
Two input modes (provide exactly one):
728728
1. ad_id only — resolves the ad's creative and fetches the attached image.
729-
2. image_hash + account_id — fetches a specific uploaded image by its hash
729+
2. account_id + image_hash — fetches a specific uploaded image by its hash
730730
(e.g. immediately after upload_ad_image or bulk_upload_ad_images, before
731731
the image is attached to any ad).
732732
733733
Args:
734+
account_id: Meta Ads account ID (act_XXXXXXXXX). Required with image_hash.
734735
ad_id: Meta Ads ad ID (numeric, e.g. "120210000000000000"). Mutually
735736
exclusive with image_hash.
736737
image_hash: Meta image hash returned by upload_ad_image /
737738
bulk_upload_ad_images. Requires account_id.
738-
account_id: Meta Ads account ID (act_XXXXXXXXX). Required with image_hash.
739739
access_token: Meta API access token (optional - will use cached token if not provided)
740740
741741
Returns:
@@ -749,8 +749,8 @@ async def get_ad_image(
749749

750750
if not ad_id:
751751
return (
752-
"Error: Provide either ad_id, or image_hash + account_id. "
753-
"Use image_hash + account_id to view an image just returned by "
752+
"Error: Provide either ad_id, or account_id + image_hash. "
753+
"Use account_id + image_hash to view an image just returned by "
754754
"upload_ad_image / bulk_upload_ad_images."
755755
)
756756

0 commit comments

Comments
 (0)