Your First Tool
The program
Section titled “The program”Start with a simple pricing calculator:
# Permissions:# No external access needed## Callers:# Any MCP client
Ask "Customer tier?" as customer tierAsk "Deal size?" as deal size
discount_rate equals 0.05If customer_tier is "premium" discount_rate equals 0.10If customer_tier is "enterprise" discount_rate equals 0.15
If deal_size is less than 10000 Fail with record with "minimum_not_met" as code and "Deal size must be at least $10,000" as message
discount equals deal_size times discount_rateRespond with record with discount as amount and discount_rate as rate and customer_tier as tierSave this as tools/calculate_discount.dvl.
The manifest
Section titled “The manifest”Create devlish.toml in the same directory:
name = "pricing-tools"version = "0.1.0"
[[tools]]source = "calculate_discount.dvl"description = "Calculate the discount amount for a deal based on customer tier and size"
[tools.inputs]customer_tier = { type = "string", description = "Customer tier: standard, premium, or enterprise" }deal_size = { type = "number", description = "Total deal value in dollars" }Start the MCP server
Section titled “Start the MCP server”devlish mcp --tools-dir ./tools/The server registers your tool with any connected MCP client (Claude Desktop, Cursor, custom agents).
Register in Claude Desktop
Section titled “Register in Claude Desktop”Add to your claude_desktop_config.json:
{ "mcpServers": { "pricing": { "command": "devlish", "args": ["mcp", "--tools-dir", "/path/to/tools"] } }}Restart Claude Desktop. The tool appears in the tool list.
What the LLM sees
Section titled “What the LLM sees”When Claude decides to call your tool, it sends:
{"customer_tier": "enterprise", "deal_size": 500000}Your program runs and returns:
{ "success": true, "responded": true, "response": {"amount": 75000, "rate": 0.15, "tier": "enterprise"}}If the input is invalid (deal_size too small), it returns:
{ "success": false, "response": {"code": "minimum_not_met", "message": "Deal size must be at least $10,000"}}The LLM reads the code field, understands the error, and retries with corrected input.
What’s next
Section titled “What’s next”- MCP Server reference - full configuration options
- Permissions - control what your tools can access
- Checkpoints - pause execution for LLM review