Overview
Every MCP tool in Pylar has a structured configuration that defines how it works. Understanding these components helps you create better tools and troubleshoot issues.Accessing Tool Details
To view a tool’s structure:- Navigate to your project
- Find the tool in the “MCP Tools” section of the right sidebar
- Click on the tool to open its details
Tool Components
1. Function Name
The function name is how agents identify and call your tool. Location: At the top of the tool view Characteristics:- Must be unique within your project
- Should be descriptive and clear
- Follows naming conventions (snake_case is common)
- Can be renamed at any time
fetch_engagement_scores_by_event_type
Choose function names that clearly indicate what the tool does. Agents will use this name to invoke the tool.
2. Description
The description tells AI agents what your tool does and when to use it. Location: Below the function name Characteristics:- Written in natural language
- Should be clear and concise
- Helps agents decide when to use the tool
- Visible to agents when they browse available tools
The description is crucial for agents. Make it specific enough that agents understand exactly what the tool does and when to use it.
3. SQL Query
The SQL query defines how the tool retrieves data from your view. Location: In the SQL Query section Characteristics:- Standard SQL syntax
- Can include parameter placeholders like
{parameter_name} - Executes against your data view
- Can be edited and refined
Parameter Placeholders
Use{parameter_name} in your SQL query where you want agent-provided values injected:
Parameter names in SQL must match parameter names exactly. Case-sensitive and spelling must be identical.
4. Parameters
Parameters define what inputs your tool accepts from agents. Location: In the Parameters section Structure:- Type: The data type (string, number, boolean, etc.)
- Required/Optional: Whether the parameter must be provided
- Description: What the parameter represents
- Properties: Additional constraints or validations
Parameter Types
Common parameter types:- string: Text values
- number: Numeric values (integers or decimals)
- boolean: True/false values
- array: Lists of values
- object: Complex nested structures
5. Tool Call Arguments
Tool call arguments are test values used to verify your tool works. Location: In the Tool Call Arguments section (right side) Purpose:- Sample inputs for testing
- Can be modified during testing
- Help validate tool behavior
- Don’t affect production tool calls
Use realistic test values that represent how agents will actually use your tool. This helps catch issues early.
JSON Structure
You can view the complete tool structure as JSON by clicking “JSON view”.Complete JSON Example
JSON Structure Breakdown
- function_name: Tool identifier
- description: What the tool does
- query: SQL query with parameter placeholders
- parameters: Parameter definitions (type, required, properties)
- tool_call: Test arguments for validation
The JSON view is useful for understanding the complete tool structure and for debugging. It shows exactly how the tool is configured.
How Components Work Together
The Flow
- Agent Calls Tool: Uses the function name
- Agent Provides Parameters: Sends values for required/optional parameters
- Query Execution: Parameters replace placeholders in SQL
- Results Returned: Query results sent back to agent
Example Flow
Agent Request:Best Practices
Function Names
- ✅ Use descriptive names:
get_customer_revenue_by_date_range - ✅ Follow naming conventions: snake_case
- ✅ Be specific:
fetch_engagement_scores_by_event_typenotget_data - ❌ Avoid abbreviations unless widely understood
Descriptions
- ✅ Be clear and specific
- ✅ Mention what data is returned
- ✅ Note any important behaviors (like partial matching)
- ❌ Avoid vague descriptions like “gets data”
SQL Queries
- ✅ Use parameter placeholders for dynamic values
- ✅ Test queries manually before creating tools
- ✅ Include ORDER BY for predictable results
- ✅ Consider performance (use LIMIT when appropriate)
Parameters
- ✅ Make parameters required when they’re essential
- ✅ Provide clear descriptions
- ✅ Use appropriate types (string, number, etc.)
- ✅ Consider adding validation constraints
Common Patterns
Pattern 1: Single Filter
Pattern 2: Date Range
Pattern 3: Search with LIKE
Pattern 4: Multiple Filters
Next Steps
Now that you understand tool structure:- Editing MCP Tools - Learn how to modify tools
- Testing Your Tools - Verify tools work correctly
- Publishing Tools - Make tools available to agents
Edit Your Tool
Learn how to refine and customize your tools