Skip to content

Custom Tools

Naveen Raj edited this page Apr 11, 2026 · 1 revision

Custom Tools

Turn any automation workflow or Python logic into an agent tool — without writing an MCP server.


n8n Webhook Tools

Convert any n8n workflow into an agent tool via webhook.

Steps:

  1. Build a workflow in n8n (or any webhook-compatible automation tool)
  2. Copy the webhook URL
  3. In Synapse, open Settings → Custom Tools
  4. Click Add Tool and fill in:
    • Name — what the agent calls this tool (e.g., send_slack_message)
    • Description — what the tool does (the agent reads this to decide when to use it)
    • Webhook URL — your n8n webhook endpoint
    • Input Schema — JSON schema for the parameters the agent should pass
  5. Save — the agent now has this tool

The agent sees the name, description, and schema, and calls it like any other tool. n8n handles the actual logic and its 400+ node library.

Example: Slack notifier tool

{
  "name": "send_slack_message",
  "description": "Sends a message to a Slack channel",
  "url": "https://your-n8n.com/webhook/slack-notify",
  "schema": {
    "channel": { "type": "string", "description": "Slack channel name" },
    "message": { "type": "string", "description": "Message content" }
  }
}

Python Script Tools

Write a Python function and expose it as an agent tool.

Steps:

  1. Open Settings → Custom Tools
  2. Click Python Tool tab
  3. Write your function in the editor — the function signature defines the tool's inputs
  4. Add a docstring — this becomes the tool's description for the agent
  5. Save — the tool is immediately available

Example: Price lookup tool

def get_stock_price(ticker: str) -> dict:
    """
    Fetches the current stock price for a given ticker symbol.
    Returns price, volume, and change percentage.
    """
    import requests
    response = requests.get(f"https://api.example.com/quote/{ticker}")
    return response.json()

The Python Tool Editor supports:

  • Full Python 3 syntax
  • Access to the vault (read/write files)
  • Standard library + common packages
  • Real-time syntax checking

When to Use Each

Use Case Recommended
Multi-step workflows with existing n8n automations n8n webhook
Integrating with internal APIs you've already automated n8n webhook
Simple Python logic (calculations, data transformation) Python script
Calling external APIs with custom auth Python script
Complex workflows with 400+ n8n nodes n8n webhook
Prototyping a new tool quickly Python script

Tips

  • Descriptions are critical — the agent decides when to use a tool based on its description. Be specific and accurate.
  • Input schemas — define only the parameters the agent needs to provide; handle defaults and secrets server-side
  • Return structured data — return dicts/JSON rather than plain text so agents can extract specific fields
  • Test the webhook before wiring it to an agent — use a REST client to verify inputs and outputs

See Also

Clone this wiki locally