Skip to main content
Glama

tool_that_access_request

Retrieve user request data by providing a username through the Simple HTTP MCP Server, enabling remote execution of Python functions with type safety and async support.

Instructions

Access the request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe username of the user

Implementation Reference

  • The handler function implementing the core logic of 'tool_that_access_request'. It accesses the request headers, updates the context with the called tool, and returns a personalized message based on the input username and a test header.
    async def tool_that_access_request( args: Arguments[ToolThatAccessRequest], ) -> ToolThatAccessRequestOutput: """Access the request.""" test_header = args.request.headers.get("X-TEST-HEADER") args.get_state_key("context", Context).add_called_tool("tool_that_access_request") return ToolThatAccessRequestOutput( message=f"Hello {args.inputs.username} you are authenticated with {test_header}", )
  • Pydantic input schema for the 'tool_that_access_request' tool, defining the 'username' field.
    class ToolThatAccessRequest(BaseModel): username: str = Field(description="The username of the user")
  • Pydantic output schema for the 'tool_that_access_request' tool, defining the 'message' field.
    class ToolThatAccessRequestOutput(BaseModel): message: str = Field(description="The message to the user")
  • Registration of the 'tool_that_access_request' tool in the TOOLS tuple, specifying the function, input schema, and output schema.
    Tool( func=tool_that_access_request, inputs=ToolThatAccessRequest, output=ToolThatAccessRequestOutput, ),

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yeison-liscano/http_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server