MCI Tools
Tools are the core building blocks of MCI. They define individual actions that can be executed, such as API requests, CLI commands, file operations, and text generation. This document explains each tool execution type and how to use them effectively.What are Tools?
A tool in MCI is a reusable definition that specifies:- What it does (description)
- What inputs it accepts (inputSchema)
- How to execute it (execution configuration)
Tool Execution Types
MCI supports four execution types:- HTTP - API requests to web services
- CLI - Command-line programs and scripts
- File - Reading files with template processing
- Text - Simple text generation with templates
HTTP Execution (API Tools)
HTTP execution allows you to define API requests as tools. This is perfect for integrating with REST APIs, webhooks, and web services.Basic API Request
POST Request with JSON Body
Workflow Integration (n8n, Zapier, Make)
One of the powerful features of HTTP tools is the ability to integrate workflow automation platforms like n8n, Zapier, or Make.com as agent tools: n8n Webhook Example:Authentication Options
API Key in Header:CLI Execution (Command-Line Tools)
CLI execution allows you to run command-line programs, scripts, and system commands. This is useful for DevOps tasks, data processing, and integrating with existing command-line tools.Basic Command
Running Script Files
One of the most powerful features of CLI execution is the ability to run script files directly. This works with any scripting language: Python Script:Dynamic Flags
CLI tools support dynamic flags based on input properties (bool, if true = flag added):Working Directory
Set a working directory for command execution:File Execution (Template Files)
File execution reads file contents and processes them with MCI’s templating system. This is the best way to manage prompts because of advanced templating features that all MCI adapters support.Why File Execution is Best for Prompts
- Advanced Templating: Full support for variables, conditionals, and loops
- Separation of Concerns: Keep prompts separate from code
- Easy Maintenance: Edit prompts without changing code
- Version Control: Track prompt changes in your repository
- Reusability: Same prompt templates across multiple tools
Basic File Reading
Prompt Template Examples
Simple Prompt (prompts/greeting.txt):Note:.lenghtsupported with Python adapter, sincedictalready has the needed key.
Advanced Template File
prompts/complex-task.txt:File Execution Without Templates
You can also read files without template processing:Text Execution (Simple Templates)
Text execution returns templated text directly from the schema. This is perfect for simple messages, quick responses, or computed strings.Basic Text
Text with Conditionals
Computed Strings
Comparison Table
| Feature | HTTP | CLI | File | Text |
|---|---|---|---|---|
| Best For | API calls, webhooks | Scripts, commands | Prompts, configs | Simple messages |
| Complexity | Medium-High | Medium | Low | Low |
| Templating | ✓ | ✓ | ✓ (Advanced) | ✓ (Advanced) |
| External Deps | API endpoints | System commands | File system | None |
| Use Case | REST APIs, workflows | DevOps, data processing | Prompt management | Quick responses |
Best Practices
1. Choose the Right Type
- HTTP: When integrating with web APIs or workflow platforms
- CLI: When running existing scripts or system commands
- File: When managing complex prompts or templates
- Text: When generating simple, inline text
2. Use File Execution for Prompts
3. Leverage Script Execution
Instead of inline commands, use script files:4. Keep Secrets in Environment Variables
5. Add Descriptive Metadata
6. Use text for static assets
Summary
- HTTP Tools: Perfect for API integration and workflow automation (n8n, Zapier, Make)
- CLI Tools: Run scripts (.py, .js, .php) and binaries for DevOps and data processing
- File Tools: The best way to manage prompts with advanced templating
- Text Tools: Quick and simple text generation
