Skip to content

Commit 430e41f

Browse files
authored
chore: use JSON for inputSchema in @mcp prompt (#197)
1 parent e0b6292 commit 430e41f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lua/mcphub/utils/prompt.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local M = {}
77
local State = require("mcphub.state")
88
local log = require("mcphub.utils.log")
99
local native = require("mcphub.native")
10+
local utils = require("mcphub.utils")
1011
local validation = require("mcphub.utils.validation")
1112

1213
---@return string
@@ -90,8 +91,8 @@ local function format_tools(tools)
9091
result = result .. string.format("\n\n- %s: %s", tool.name, M.get_description(tool):gsub("\n", "\n "))
9192
local inputSchema = M.get_inputSchema(tool)
9293
result = result
93-
.. "\n\n Input Schema:\n\n ```lua\n "
94-
.. vim.inspect(inputSchema):gsub("\n", "\n ")
94+
.. "\n\n Input Schema:\n\n ```json\n "
95+
.. utils.pretty_json(vim.json.encode(inputSchema)):gsub("\n", "\n ")
9596
.. "\n ```"
9697
end
9798
return result

0 commit comments

Comments
 (0)