Skip to content

Not passing parameters that are filled in the web interface. #393

Open
@phazei

Description

@phazei
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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtoolsIssues related to testing tools

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions