inspector icon indicating copy to clipboard operation
inspector copied to clipboard

Not passing parameters that are filled in the web interface.

Open phazei opened this issue 7 months ago • 0 comments

Image

Describe the bug I expect what I typed in the box to be submitted.

This is my code:


    @override
    def register(self, mcp_server: FastMCP) -> None:
        """Register this run command tool with the MCP server.
        
        Creates a wrapper function with explicitly defined parameters that match
        the tool's parameter schema and registers it with the MCP server.
        
        Args:
            mcp_server: The FastMCP server instance
        """
        tool_self = self  # Create a reference to self for use in the closure
        
        @mcp_server.tool(name=self.name, description=self.mcp_description)
        async def run_command(ctx: MCPContext, command: str, cwd: str, shell_type: str | None = None, use_login_shell: bool = True) -> str:
            return await tool_self.call(ctx, command=command, cwd=cwd, shell_type=shell_type, use_login_shell=use_login_shell)

    @property
    @override
    def parameters(self) -> dict[str, Any]:
        """Get the parameter specifications for the tool.
        
        Returns:
            Parameter specifications
        """
        return {
            "properties": {
                "command": {
                    "title": "Command",
                    "type": "string"
                },
                "cwd": {
                    "title": "Cwd",
                    "type": "string"
                },
                "shell_type": {
                    "anyOf": [
                        {"type": "string"},
                        {"type": "null"}
                    ],
                    "default": None,
                    "title": "Shell Type"
                },
                "use_login_shell": {
                    "default": True,
                    "title": "Use Login Shell",
                    "type": "boolean"
                }
            },
            "required": ["command", "cwd"],
            "title": "run_commandArguments",
            "type": "object"
        }

Additional context Windows 11 I'm running 0.12.0 that I installed via npm install since the version isn't in npm yet.

phazei avatar May 11 '25 02:05 phazei