# MCP tools need clear JSON Schema inputSchema

**Date:** 2025-12-14  
**Tags:** MCP, AI, Integration  
**URL:** https://kelexine.is-a.dev/til/mcp-tool-definition

---

TIL: MCP tools need clear JSON Schema inputSchema. The AI uses this to understand what parameters to provide. Include descriptions for each property—they directly influence how well the AI uses your tool.


```javascript
{
  name: "query_database",
  description: "Run read-only SQL query",
  inputSchema: {
    type: "object",
    properties: {
      query: {
        type: "string",
        description: "SQL SELECT statement"
      }
    },
    required: ["query"]
  }
}
```




---

*This content is available at [kelexine.is-a.dev/til/mcp-tool-definition](https://kelexine.is-a.dev/til/mcp-tool-definition)*
