Fix read-resource command returning "Error: invalid JSON for params: invalid character %q looking for beginning of value"
#27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While attempting to use the
read-resourcecommand to troubleshoot an issue with an MCP server I am currently working on, I was seeing the following error (mcptools dev@5d86d52):Upon closer inspection, it appears the
read-resourcecommand was trying to marshal the required commands to run the given MCP server as JSON. I could not find any reason to do this -- it seems to have been an errant copy-pasta after recent refactors? After removing it, the command worked for me. I also fixed up a couple of other things while I was in the area.cmd/mcptools/commands:json.UnmarshalofparsedArgsinReadResourceCmd()ReadResourceCmd()pkg/jsonutils:formatGenericMap()due to colour escape sequences.