Skip to main content
Glama
xytangme

NeoDB MCP Server

Official
by xytangme

get-user-info

Retrieve basic user information from NeoDB's social book cataloging service to access account details and personalize your reading experience.

Instructions

Get current user's basic info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of all tools via @server.list_tools(), specifically including the get-user-info tool with its schema.
    @server.list_tools() async def handle_list_tools() -> list[types.Tool]: """ List available tools. Each tool specifies its arguments using JSON Schema validation. """ return [ types.Tool( name="get-user-info", description="Get current user's basic info", inputSchema={ "type": "object", "properties": {}, # No parameters needed "required": [], }, ), types.Tool( name="search-books", description="Search items in catalog", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Search query for books", } }, "required": ["query"], }, ), types.Tool( name="get-book", description="Get detailed information about a specific book", inputSchema={ "type": "object", "properties": { "book_id": { "type": "string", "description": "The ID of the book to retrieve", }, }, "required": ["book_id"], }, ), ]
  • Schema definition for get-user-info tool: no input parameters required.
    types.Tool( name="get-user-info", description="Get current user's basic info", inputSchema={ "type": "object", "properties": {}, # No parameters needed "required": [], }, ),
  • Implementation of the get-user-info tool handler: calls NeoDB /api/me endpoint using access token, handles errors, and returns formatted user information.
    if name == "get-user-info": """ https://neodb.social/developer/#/user/users_api_me """ async with httpx.AsyncClient() as client: user_data, status_code = await make_neodb_request( client, access_token, '/api/me', api_base ) if status_code != 200: error_message = { 401: "Unauthorized", }.get(status_code, f"Request failed with status code: {status_code}") return [types.TextContent(type="text", text=error_message)] if not user_data: return [types.TextContent(type="text", text="Failed to retrieve user information")] # Format user information user_text = ( f"User Information:\n" f"Username: {user_data.get('username', 'Unknown')}\n" f"Display Name: {user_data.get('display_name', 'Unknown')}\n" f"Email: {user_data.get('email', 'Not provided')}\n" f"URL: {user_data.get('url', 'Not provided')}\n" f"Account Created: {user_data.get('created_at', 'Unknown')}\n" ) return [ types.TextContent( type="text", text=user_text ) ]

Other 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/xytangme/neodb-mcp'

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