> ## Documentation Index
> Fetch the complete documentation index at: https://prismeai-legacy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools Integration

> Enhance your knowledge agents with powerful tools to extend their capabilities beyond information retrieval

Tools transform your knowledge agents from passive information providers into active problem solvers. By integrating specialized capabilities, your agents can perform tasks, retrieve real-time data, make calculations, and connect to enterprise systems—all while maintaining the conversational experience users expect.

## What Are Tools?

In Prisme.ai, tools are specialized functions that extend an agent's capabilities beyond retrieving and presenting information from your knowledge base. They allow agents to:

<CardGroup cols="2">
  <Card title="Perform Actions" icon="bolt">
    Execute tasks based on user requests
  </Card>

  <Card title="Access Live Data" icon="database">
    Retrieve real-time information from external systems
  </Card>

  <Card title="Process Information" icon="gear">
    Perform calculations, transformations, and analysis
  </Card>

  <Card title="Integrate with Systems" icon="link">
    Connect with enterprise applications and services
  </Card>
</CardGroup>

## Tool Types

Prisme.ai supports several types of tools, each with specific purposes and capabilities:

<Tabs>
  <Tab title="Native Tools">
    Built-in tools provided by Prisme.ai, ready to use with minimal configuration.

    <Properties>
      <Property name="Setup Complexity" value="Low" />

      <Property name="Customization" value="Configuration parameters only" />

      <Property name="Maintenance" value="Handled by Prisme.ai" />

      <Property name="Use Cases" value="Common functions across organizations" />
    </Properties>
  </Tab>

  <Tab title="Custom Code Tools">
    Tools created using code that runs directly in Prisme.ai's secure environment.

    <Properties>
      <Property name="Setup Complexity" value="Medium" />

      <Property name="Customization" value="Full code control" />

      <Property name="Maintenance" value="Managed within Prisme.ai" />

      <Property name="Use Cases" value="Organization-specific logic and processing" />
    </Properties>
  </Tab>

  <Tab title="API Connector Tools">
    Tools that integrate with external APIs and web services.

    <Properties>
      <Property name="Setup Complexity" value="Medium" />

      <Property name="Customization" value="API parameters and mapping" />

      <Property name="Maintenance" value="Depends on external API stability" />

      <Property name="Use Cases" value="Integration with external services and data sources" />
    </Properties>
  </Tab>

  <Tab title="Webhook Tools">
    Tools that trigger external processes and receive their results.

    <Properties>
      <Property name="Setup Complexity" value="Medium to High" />

      <Property name="Customization" value="External system determines capabilities" />

      <Property name="Maintenance" value="Shared between Prisme.ai and external systems" />

      <Property name="Use Cases" value="Complex workflows, legacy system integration" />
    </Properties>
  </Tab>

  <Tab title="Database Tools">
    Tools that connect directly to databases for query and retrieval.

    <Properties>
      <Property name="Setup Complexity" value="Medium to High" />

      <Property name="Customization" value="SQL queries and data mapping" />

      <Property name="Maintenance" value="Depends on database schema stability" />

      <Property name="Use Cases" value="Structured data retrieval and reporting" />
    </Properties>
  </Tab>
</Tabs>

## Common Tools

Prisme.ai includes a growing library of native tools that you can add to your agents with minimal configuration:

<AccordionGroup>
  <Accordion title="Web Search">
    Enable your agent to search the web for current information beyond your knowledge base.

    **Capabilities**: Real-time web search with configurable sources

    **Use Cases**: Current events, market data, general knowledge

    **Configuration Options**: Search providers (Google, Bing, DuckDuckGo), result filtering, result count, safe search settings, domain restrictions

    **Example Implementation**:

    ```
    - YourWebSearch.search:
        query: "{{input.text}}"
        provider: "google"
        resultCount: 5
        safeSearch: true
        output: searchResults
    - set:
        name: output
        value:
          value: "{{searchResults}}"
          description: "Web search results for: {{input.text}}"
    ```
  </Accordion>

  <Accordion title="Code Interpreter">
    Perform mathematical calculations including arithmetic, algebra, statistics, and unit conversions.

    **Capabilities**: Complex math operations with memory and variables

    **Use Cases**: Financial calculations, engineering formulas, data analysis
  </Accordion>

  <Accordion title="Image Generator">
    Create custom images from text descriptions using AI generation capabilities.

    **Capabilities**: Generate images from text prompts with style controls

    **Use Cases**: Visual content creation, concept visualization, design assistance
  </Accordion>

  <Accordion title="Document Search">
    Search through document collections using keywords and filters.

    **Capabilities**: Text search across document repositories

    **Use Cases**: Knowledge retrieval, research assistance, content discovery

    **Example Implementation**:

    ```yaml theme={null}
    - MyAgent.listDocuments:
        page: 0
        limit: 20
        filters:
          - field: content
            type: textSearch
            value: "{{body.arguments.keywords}}"
        includeContent: true
        provider: crawler
        output: documents
        includeMetadata: true
    - set:
        name: output
        value:
          value: "{{documents}}"
          description: "documents using the keyword search: {{body.arguments.keywords}}"
    ```
  </Accordion>

  <Accordion title="Query Reformulation">
    Generate alternative phrasings of user questions to improve search results.

    **Capabilities**: Create semantic variations of input questions

    **Use Cases**: Search enhancement, query expansion, intent clarification

    **Example Implementation**:

    ```yaml theme={null}
    - MyAgent.chat-completion:
        messages:
          - role: assistant
            content: Given the following user question, generate 3 alternative phrasings that express the same intent. Return the result as a JSON object with a "reformulations" key.
          - role: user
            content: 'Question: "{{user_question}}"'
        output: reformulations
    - set:
        name: output
        value:
          value: "{{reformulations}}"
          description: alternative phrasings of user question
    ```
  </Accordion>
</AccordionGroup>

## Creating Custom Tools

You can create custom tools to address specific needs in your organization:

<Steps>
  <Step title="Define Tool Requirements">
    Determine what the tool should do and how it should interact with users and systems.

    Consider:

    * What problem does this tool solve?
    * What inputs will it need?
    * What outputs should it provide?
    * Which systems will it interact with?
    * What security considerations are important?
  </Step>

  <Step title="Select Tool Type">
    Choose the most appropriate tool type based on your requirements.

    Tool selection guidance:

    * Use native tools for common functions
    * Choose custom code for specialized logic
    * Select API connectors for external service integration
    * Use webhooks for complex process orchestration
    * Implement database tools for structured data queries
  </Step>

  <Step title="Configure or Develop the Tool">
    Set up the tool's parameters or develop its code.

    For custom development:

    * Create clear input/output schemas
    * Implement robust error handling
    * Ensure appropriate security measures
    * Test with various input scenarios
    * Document the tool's functionality
  </Step>

  <Step title="Test the Tool">
    Verify that the tool works as expected in different scenarios.

    Testing should include:

    * Basic functionality verification
    * Edge case handling
    * Performance assessment
    * Security testing
    * Integration testing with agent
  </Step>

  <Step title="Add to Your Agent">
    Integrate the tool with your knowledge agents.

    During integration:

    * Provide clear tool descriptions
    * Configure when the tool should be used
    * Set appropriate permissions
    * Define error handling behavior
    * Test the agent with the new tool
  </Step>
</Steps>

## Tool Usage Strategies

Effective tool integration requires thoughtful configuration of when and how tools are used:

<AccordionGroup>
  <Accordion title="Tool Selection Logic">
    Configure how the agent decides which tool to use in different situations.

    <Properties>
      <Property name="Options">
        * Rule-based: Define explicit conditions for tool use
        * AI-based: Let the model decide when to use tools
        * Hybrid: Combine rules with AI judgment
      </Property>

      <Property name="Considerations">
        * Precision vs. flexibility
        * Error handling approach
        * User experience consistency
      </Property>
    </Properties>
  </Accordion>

  <Accordion title="User Confirmation">
    Determine when the agent should ask for permission before using tools.

    <Properties>
      <Property name="Options">
        * Always confirm: Ask user before any tool use
        * Selective confirmation: Confirm for specific tools or actions
        * No confirmation: Execute tools automatically
      </Property>

      <Property name="Considerations">
        * User trust and transparency
        * Action reversibility
        * Conversation flow impact
      </Property>
    </Properties>
  </Accordion>

  <Accordion title="Tool Result Presentation">
    Configure how tool results are presented to users.

    <Properties>
      <Property name="Options">
        * Integrated: Blend tool results into the conversation
        * Structured: Display results in formatted cards or sections
        * Attachments: Provide results as downloadable files
      </Property>

      <Property name="Considerations">
        * Data complexity
        * Visual presentation needs
        * User expectation alignment
      </Property>
    </Properties>
  </Accordion>

  <Accordion title="Fallback Handling">
    Define behavior when tools fail or produce unexpected results.

    <Properties>
      <Property name="Options">
        * Graceful degradation: Fall back to knowledge base
        * Retry logic: Attempt alternative approaches
        * User assistance: Ask for clarification or additional input
      </Property>

      <Property name="Considerations">
        * Error transparency
        * User experience continuity
        * System resilience
      </Property>
    </Properties>
  </Accordion>
</AccordionGroup>

## Integration Examples

<Tabs>
  <Tab title="Customer Support">
    **Agent Purpose**: Answer product questions and resolve customer issues

    **Integrated Tools**:

    * Ticket Creator: Create support tickets for complex issues
    * Order Lookup: Check order status and details
    * Product Catalog: Access current product information
    * Document Analyzer: Process customer documents and screenshots
    * Email Composer: Send confirmation and follow-up emails

    **Benefits**:

    * Streamlined issue resolution
    * Reduced handoffs between systems
    * Consistent information across channels
  </Tab>

  <Tab title="Financial Advisor">
    **Agent Purpose**: Provide financial guidance and investment information

    **Integrated Tools**:

    * Calculator: Perform financial calculations and projections
    * Market Data: Access current market information
    * Portfolio Analyzer: Review investment performance
    * Document Generator: Create investment proposals and reports
    * Meeting Scheduler: Book consultations with human advisors

    **Benefits**:

    * Data-driven recommendations
    * Comprehensive financial analysis
    * Seamless transition to human advisors
  </Tab>

  <Tab title="HR Assistant">
    **Agent Purpose**: Support employees with HR policies and processes

    **Integrated Tools**:

    * Form Generator: Create and fill HR forms
    * Time-Off Calculator: Check and calculate leave balances
    * Benefits Lookup: Access personalized benefits information
    * Document Analyzer: Process employee documentation
    * Ticket Creator: Generate tickets for HR case management

    **Benefits**:

    * Self-service for common HR needs
    * Personalized policy guidance
    * Streamlined HR processes
  </Tab>

  <Tab title="Research Assistant">
    **Agent Purpose**: Support research activities and information synthesis

    **Integrated Tools**:

    * Web Search: Find current information across sources
    * Document Analyzer: Extract data from research papers
    * Data Visualizer: Create charts and visualizations
    * Citation Generator: Format and manage references
    * File Generator: Compile research summaries

    **Benefits**:

    * Comprehensive information gathering
    * Data-driven insights
    * Efficient research documentation
  </Tab>
</Tabs>

## Security and Governance

Ensuring secure and responsible tool usage is critical:

<CardGroup cols="2">
  <Card title="Authentication & Authorization" icon="lock">
    Configure secure access to tools and their underlying systems.

    Key Controls

    :

    <ul>
      Tool-specific permissions

      API key management

      Credential rotation

      User-based access control
    </ul>
  </Card>

  <Card title="Data Privacy" icon="shield">
    Ensure tools handle sensitive information appropriately.

    Key Controls

    :

    <ul>
      Data minimization

      Information redaction

      Temporary storage policies

      Privacy-preserving integration
    </ul>
  </Card>

  <Card title="Logging & Auditing" icon="list-check">
    Maintain records of tool usage for compliance and security.

    Key Controls

    :

    <ul>
      Comprehensive activity logs

      Tool usage analytics

      Audit trails

      Anomaly detection
    </ul>
  </Card>

  <Card title="Rate Limiting & Quotas" icon="gauge">
    Prevent abuse and manage resource consumption.

    Key Controls

    :

    <ul>
      Usage quotas

      Rate limiting

      Cost controls

      Resource allocation
    </ul>
  </Card>
</CardGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Tool Selection">
    * Start with native tools when possible for easier maintenance
    * Choose tools that solve specific user problems
    * Consider the full lifecycle of the tool, including updates and maintenance
    * Select the simplest tool type that meets your requirements
    * Prioritize tools that integrate with existing systems
  </Accordion>

  <Accordion title="Tool Configuration">
    * Provide clear, specific descriptions of what each tool does
    * Set appropriate input validation to prevent errors
    * Configure sensible defaults for optional parameters
    * Include example inputs to guide users
    * Test tool configuration with various scenarios
  </Accordion>

  <Accordion title="User Experience">
    * Make tool usage transparent to users
    * Provide clear feedback when tools are being used
    * Format tool results for readability and understanding
    * Balance automation with user control
    * Implement graceful error handling with helpful messages
  </Accordion>

  <Accordion title="Tool Management">
    * Regularly review tool usage and performance
    * Monitor for errors and unexpected behavior
    * Update tool configurations as underlying systems change
    * Document tool purpose, configuration, and integration
    * Establish a testing protocol for tool updates
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols="2">
  <Card title="Agent Testing" icon="vial" href="agent-testing">
    Learn how to test and validate your tool-enabled agents
  </Card>

  <Card title="Advanced RAG" icon="wand-sparkles" href="advanced-rag">
    Combine tools with advanced RAG techniques
  </Card>

  <Card title="RAG Configuration" icon="sliders" href="rag-configuration">
    Configure how tools interact with your knowledge base
  </Card>

  <Card title="Analytics" icon="chart-line" href="analytics">
    Monitor tool usage and performance
  </Card>
</CardGroup>
