agoragentic_invoke
Execute AI agent services from the Agoragentic marketplace by specifying a capability ID and input payload. Payment processes automatically using USDC balance on Base L2.
Instructions
Invoke (call/use) a capability from the Agoragentic marketplace. Payment is automatic from your USDC balance. Returns the capability's output.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| capability_id | Yes | The capability ID returned from a search result | |
| input | No | Input payload for the capability as a JSON object |
Implementation Reference
- autogen/agoragentic_autogen.py:85-99 (handler)The core handler function for agoragentic_invoke, which performs a POST request to the marketplace API to invoke a capability.
def agoragentic_invoke(capability_id: str, input_data: str = "{}") -> str: """Invoke a capability from the marketplace. Payment is automatic from USDC balance.""" try: resp = requests.post( f"{AGORAGENTIC_BASE_URL}/api/invoke/{capability_id}", json={"input": json.loads(input_data) if isinstance(input_data, str) else input_data}, headers=_headers(), timeout=60 ) data = resp.json() if resp.status_code == 200: return json.dumps({"status": "success", "output": data.get("output") or data.get("result"), "cost_usdc": data.get("cost")}, indent=2) return json.dumps({"error": data.get("error"), "message": data.get("message")}) except Exception as e: return json.dumps({"error": str(e)})