Skip to content
Last updated

About tools

Tools are the fundamental building blocks of Agen for SaaS. Each tool represents a single API operation — an endpoint that AI agents can discover, understand, and invoke through your MCP Gateway.


What is a tool

A tool is a structured definition of an API operation that includes everything an AI agent needs to understand and call it:

PropertyDescriptionLimit
Tool nameA unique identifier for the tool (e.g., Create_a_new_expense, Delete_receipt).
Tool descriptionA human-readable explanation of what the tool does. AI agents use this to decide when and how to invoke the tool.2,000 characters
Tool APIThe HTTP method (GET, POST, PUT, DELETE) and path (e.g., /api/receipts/{id}).
Source nameThe source this tool was generated from (e.g., default, Frontegg).

How tools are created

extracted-tools

Tools are automatically generated when you add a source to your Agen for SaaS instance:

  • REST sources — Each endpoint defined in your OpenAPI specification becomes a tool. The tool name, description, method, and path are extracted from the spec.
  • GraphQL sources — Each query and mutation in your GraphQL schema becomes a tool.
  • MCP server sources — Tools are discovered dynamically from the remote MCP server.
  • Frontegg source — Built-in tools that expose Frontegg platform capabilities (e.g., ApprovalFlowsController_createApp..., GeoFencesTenantController_create...).

After generation, every tool property is fully editable.


How tools work at runtime

When an AI agent interacts with your MCP Gateway:

  1. Discovery — The agent calls the MCP list_tools endpoint. Agen for SaaS returns all enabled tools that the user has access to (filtered by access control rules and List tools hooks).
  2. Selection — The AI agent reads tool descriptions and selects the appropriate tool for the user's request.
  3. Invocation — The agent calls the tool with the required parameters. Agen for SaaS routes the request through the full governance pipeline:
    • Authentication — Validates the user's identity token.
    • Access control — Checks role/permission mappings.
    • Policies — Evaluates conditional rules (deny, step-up, approval).
    • Hooks — Executes any active Call tool hooks.
    • Data protection — Masks sensitive fields in the response.
  4. Forwarding — If all checks pass, the request is forwarded to the tool's API endpoint at the source's base URL.
  5. Response — The API response passes back through the pipeline (data protection masking is applied) and is returned to the AI agent.
  6. Logging — The entire interaction is recorded in the monitoring system.

Tool security layers

Every tool call passes through multiple security layers:

LayerWhat it does
Access controlEnsures the user's JWT contains the required roles or permissions to invoke the tool.
PoliciesEvaluates conditional rules based on request attributes (IP, amount, country) and enforces deny, step-up, or approval actions.
Data protectionMasks sensitive fields (PII, PHI, PCI) in tool responses based on compliance policies.
HooksExecutes custom JavaScript logic that can allow or deny the request.
MonitoringLogs the tool call, parameters, response, and all policy decisions for audit.

Tool lifecycle

Tools follow this lifecycle:

  1. Generated — Created automatically from a source (REST, GraphQL, MCP, or Frontegg).
  2. Enabled — Active and discoverable by AI agents. This is the default state after generation.
  3. Disabled — Not discoverable by AI agents. The tool definition is preserved but hidden from discovery.
  4. Edited — Tool properties (name, description, method, path) can be modified at any time.
  5. Deleted — Permanently removed. This action cannot be undone.

Best practices

  • Write clear descriptions — AI agents rely on tool descriptions to understand what each tool does. Include the action performed, expected inputs, and what the response contains.
  • Use consistent naming — Follow a naming convention that groups related tools (e.g., Create_expense, Get_expense_by_ID, Delete_expense).
  • Disable unused tools — If a tool is not needed, disable it rather than deleting it. This keeps the definition available for future use.
  • Review generated tools after import — Auto-generated names and descriptions may need refinement for clarity.
  • Combine with access control — Restrict sensitive tools to specific roles or permissions rather than leaving them broadly available.