What Are MCP Tools?
MCP (Machine-Consumable Protocol) tools are the interface between your data views and AI agents. They define how agents can query and interact with your data, translating natural language requests into structured SQL queries.The Role of MCP Tools
MCP tools serve as:- Agent Interface: The way AI agents access your data views
- Query Wrappers: SQL queries tailored to specific use cases
- Parameter Handlers: Accept inputs from agents and inject them into queries
- Security Layer: Govern how agents interact with your data
Think of MCP tools as functions that AI agents can call. Each tool has a specific purpose and knows how to query your data to fulfill that purpose.
How MCP Tools Work
The Workflow
- Create a View: Define what data agents can access
- Create MCP Tools: Build tools on top of your view
- Test Tools: Verify tools work correctly
- Publish Tools: Make them available to agent builders
- Agents Use Tools: AI agents call tools to query your data
Multiple Tools Per View
A single view can have multiple MCP tools, each serving different purposes:- Different Parameters: Each tool can accept different inputs
- Different Queries: Tools can query the same view differently
- Different Use Cases: Tools can be optimized for specific scenarios
Create multiple tools on the same view to provide agents with different ways to interact with your data. For example, one tool for filtering by date, another for filtering by customer segment.
Key Concepts
Function Name
Each tool has a unique function name that agents use to invoke it. Names should be:- Descriptive and clear
- Follow naming conventions
- Indicate the tool’s purpose
Description
The description tells agents what the tool does. It should:- Clearly explain the tool’s purpose
- Be concise but informative
- Help agents decide when to use the tool
SQL Query
The SQL query defines how the tool queries your view:- Can include parameters from the agent
- Uses placeholders like
{parameter_name} - Can be edited and refined
- Executes against your data view
Parameters
Parameters are inputs the tool accepts:- Define what data agents must provide
- Can be required or optional
- Have types (string, number, etc.)
- Include descriptions for clarity
Tool Call Arguments
Test values used to verify the tool works:- Sample inputs for testing
- Can be modified during testing
- Help validate tool behavior
Creating MCP Tools
Method 1: AI-Assisted Creation (Recommended)
Use Pylar’s AI to create tools from natural language:- Select your view in the sidebar
- Ask the AI to create a tool
- Review the generated tool
- Test and refine as needed
Method 2: Manual Creation
Create tools manually for complete control:- Define the function name
- Write the description
- Create the SQL query
- Configure parameters
- Set test arguments
Testing Your Tools
Before publishing, always test your tools:- Click “Test Run” on the tool
- Review the query execution
- Check the results
- Verify parameters work correctly
- Refine if needed
Never skip testing. A tool that works in testing will work in production, but a tool that fails testing will cause agent errors.
Publishing Tools
Once tested, publish your tools:- Click “Publish” in the sidebar
- Generate an authorization token
- Copy the MCP HTTP Stream URL and Bearer Token
- Connect to your agent builder
Next Steps
Ready to create your first tool?- Creating Tools with AI - Use AI to create tools from natural language
- Creating Tools Manually - Build tools with complete control
- Understanding Tool Structure - Learn about tool components
- Testing Your Tools - Verify tools work correctly
Create Your First Tool
Use AI to create an MCP tool in seconds