Overview
After creating an MCP tool (either with AI or manually), you’ll often want to refine it. This guide shows you how to access, view, and edit your tools.Accessing Your Tools
To view and edit a tool:- Navigate to your project in Pylar
- Look for the “MCP Tools” section in the right sidebar
- Click on the tool you want to view or edit
Tool Components Overview
When you open a tool, you’ll see:Function Name
- Located at the top
- Can be renamed by clicking and editing
- Should be descriptive and unique
Description
- Summary of what the tool does
- Visible to AI agents
- Can be edited inline
SQL Query
- The query that retrieves data
- Can be edited in the query editor
- Supports parameter placeholders
Parameters
- Input definitions for the tool
- Can add, remove, or modify parameters
- Define types and requirements
Tool Call Arguments
- Test values (right side)
- Used for testing
- Can be modified
Editing Function Name
To rename a tool:- Click on the function name at the top
- Edit the name directly
- Save your changes
Choose names that clearly indicate the tool’s purpose. Agents use function names to identify and call tools.
Editing Description
The description helps agents understand when to use your tool. To edit:- Click on the description field
- Modify the text
- Save changes
- Be specific about what data is returned
- Mention any important behaviors (e.g., “supports partial matching”)
- Keep it concise but informative
- ❌ “Gets data” (too vague)
- ✅ “Fetches engagement scores and related data filtered by event type” (clear and specific)
Editing SQL Query
The SQL query is where you define how the tool retrieves data.Accessing the Query Editor
- Find the SQL Query section in the tool view
- Click to edit (or use the edit button)
- Modify the query as needed
- Save your changes
Common Edits
Adding Filters:When editing queries, ensure parameter placeholders match parameter names exactly. Mismatched names will cause errors.
Modifying Parameters
Parameters define what inputs your tool accepts.Adding Parameters
- Go to the Parameters section
- Click Add Parameter or similar
-
Define:
- Parameter name
- Type (string, number, etc.)
- Whether it’s required
- Description
- Update your SQL query to use the new parameter
Removing Parameters
- Find the parameter in the Parameters section
- Remove it
- Update your SQL query to remove the placeholder
If you remove a parameter, make sure to also remove its placeholder from the SQL query. Otherwise, the query will fail when executed.
Modifying Parameter Properties
You can change:- Type: string → number, etc.
- Required/Optional: Make parameters required or optional
- Description: Update what the parameter represents
Updating Tool Call Arguments
Tool call arguments are test values used for verification. To update:- Find the Tool Call Arguments section (right side)
- Modify the test values
- Use these values when testing the tool
Use varied test arguments to verify your tool handles different inputs correctly. Test edge cases like empty strings, special characters, etc.
Common Editing Scenarios
Scenario 1: Refining an AI-Generated Tool
After AI creates a tool, you might want to:- Add more filters: Include additional WHERE conditions
- Change sort order: Modify ORDER BY clause
- Add columns: Return more data
- Improve description: Make it clearer for agents
Scenario 2: Fixing a Tool That’s Not Working
If a tool fails testing:- Check parameter names: Ensure placeholders match parameter names
- Verify SQL syntax: Test query manually in SQL IDE
- Check data types: Ensure parameter types match query expectations
- Review filters: Make sure WHERE conditions are valid
Scenario 3: Optimizing Performance
For slow queries:- Add LIMIT: Restrict result set size
- Refine filters: Make WHERE conditions more selective
- Remove unnecessary columns: Select only needed data
- Add indexes: Ensure source views have proper indexes
Viewing JSON Structure
To see the complete tool configuration:- Click “JSON view” button
- View the structured JSON representation
- Useful for:
- Understanding complete configuration
- Debugging issues
- Copying tool structure
Best Practices
Before Editing
- ✅ Test the current tool to understand its behavior
- ✅ Review the SQL query in the SQL IDE
- ✅ Check parameter usage in the query
While Editing
- ✅ Make incremental changes
- ✅ Test after each significant change
- ✅ Keep parameter names consistent
- ✅ Update descriptions when behavior changes
After Editing
- ✅ Always test the tool after changes
- ✅ Verify parameters work correctly
- ✅ Check that results are as expected
- ✅ Update descriptions if needed
Next Steps
After editing your tool:- Testing Your Tools - Verify your changes work correctly
- Publishing Tools - Make your tools available to agents
Test Your Changes
Verify your edited tool works correctly