AIML Docs
Datamodel

Tool Element

Element for defining MCP integrations

Tool Element

Coming soon: This feature is not yet available. Please check back soon.

The <tool> element defines an MCP (Multi-provider Context) integration, typically representing an external service or API. It makes the capabilities of this service available to <script> and <llm> elements within the application.

<tool 
  type="mcp"
  id="weather"
  url="https://mcp.composio.dev/weathermap/<your secure url>"
/>

Props

PropTypeDefault
type
"mcp" | "function"
-
id
string
-
url?
string
-
function?
function
-
args?
object
-

Examples

Basic MCP Tool

Defines a single tool for accessing a weather API.

<tool 
  type="mcp" 
  id="weather" 
  url="https://mcp.composio.dev/weathermap/<your secure url>"
/>

Multiple MCP Tools

Multiple tools can be defined within a <datamodel> to integrate with various services.

<datamodel>
  <tool 
    type="mcp"
    id="weather"
    url="https://mcp.composio.dev/weathermap/<your secure url>"
  />
  
  <tool 
    type="mcp"
    id="translator"
    url="https://api.translate.example.com"
  />
 
  <data id="currentLocation" type="STRING" value="London" />
</datamodel>

Usage Notes

  • <tool> elements are defined within a <datamodel> element.
  • They act as pointers to external MCP-compliant services.
  • The id is crucial for referencing the tool elsewhere in the application.
  • The url must point to a valid MCP server endpoint.
  • See the Using MCP Integrations guide for details on how to use these tools in scripts and LLMs.

On this page