send_to_webhook
Transmits a text prompt to an n8n webhook and returns the processed response.
Instructions
Send a prompt to the n8n webhook and get the response.
Args: prompt: The text prompt to process
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- calculator_server/server.py:164-179 (handler)The handler function for the 'send_to_webhook' tool. It sends a prompt to an n8n webhook via HTTP POST and returns the response text. Registered with @mcp.tool() decorator.
@mcp.tool() async def send_to_webhook(prompt: str) -> str: """Send a prompt to the n8n webhook and get the response. Args: prompt: The text prompt to process """ webhook_url = "Your_URL" async with httpx.AsyncClient() as client: try: response = await client.post(webhook_url, json={"prompt": prompt}, timeout=30.0) response.raise_for_status() return response.text except httpx.HTTPError as e: return f"Error sending request: {str(e)}" - calculator_server/server.py:164-164 (registration)Registration of the 'send_to_webhook' tool using the @mcp.tool() decorator on the FastMCP server instance.
@mcp.tool()