Hasty Briefsbeta

MCP Tools and Dependent Types

6 days ago
  • #LLM
  • #Defold
  • #MCP
  • The author experimented with creating an MCP server for the Defold editor to allow Claude (an AI) to evaluate Lua code within the editor's scripting context.
  • The AI's approach was entertaining but inaccurate, preferring trial-and-error over documentation, which may become frustrating as LLM accuracy expectations rise.
  • Structured outputs via JSON schemas are a common solution for improving LLM accuracy, where tools define input schemas that the AI must adhere to.
  • A challenge arises with dynamically resolving JSON schemas for complex domains, such as editing 3D models in Defold, where data shapes depend on runtime context.
  • The proposed solution involves a two-step process: first, the AI selects a resource, then the system constructs a JSON schema based on the resource's data shape for the AI to use.
  • Current MCP lacks support for dependent types or dynamic schema resolution, which would enable more complex interactions like the proposed edit_resource tool with schema lookup.