-
-
Notifications
You must be signed in to change notification settings - Fork 577
Open
Description
Problem
All tool descriptions in src/server.ts contain excessive leading whitespace due to the way template literals are indented in the code. This results in poor formatting when the descriptions are displayed to users through the MCP client.
Current Behavior
Tool descriptions appear with significant left padding. Below is an example of using desktop-commander in AIShell:
Expected Behavior
Tool descriptions should appear clean without excessive indentation.
Root Cause
The template literals in the description fields are using the same indentation as the surrounding code, which includes the whitespace in the final string output.
Solution Options
-
Manual formatting - Start template literals at column 0:
description: `Get the complete server configuration as JSON. Config includes fields for: - blockedCommands (array of blocked shell commands) - defaultShell (shell to use for commands) ${CMD_PREFIX_DESCRIPTION}`,
-
Use a dedent function - Create or import a utility to strip common leading
import dedent from 'dedent'; description: dedent` Get the complete server configuration as JSON. Config includes fields for: - blockedCommands (array of blocked shell commands) - defaultShell (shell to use for commands) ${CMD_PREFIX_DESCRIPTION} `
wonderwhy-er
Metadata
Metadata
Assignees
Labels
No labels