Check out what Gzuuus DBTH etc are doing with DVMCP. Each tool defines it's parameters in a NIP-89 declaration, then responds in the DVM style (5910, 6910, 7000), when tagged, based on those params.
Very extensible for any tool to use (an AI, or any API, as a tool). Can define and require any parameters (context window size for an AI, stock symbol for a price query, etc).