get-user-info
Retrieve basic user information from NeoDB, a social book cataloging service, using this API tool for accessing profile details.
Instructions
Get current user's basic info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/neodb/server.py:116-154 (handler)Handler implementation for the 'get-user-info' tool. Fetches user data from the NeoDB API endpoint '/api/me' using the provided access token, handles errors, and formats the user information (username, display name, email, URL, created_at) into a text response.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 ) ]
- src/neodb/server.py:20-28 (registration)Registration of the 'get-user-info' tool in the list_tools handler, including name, description, and empty input schema (no parameters required).types.Tool( name="get-user-info", description="Get current user's basic info", inputSchema={ "type": "object", "properties": {}, # No parameters needed "required": [], }, ),
- src/neodb/server.py:20-28 (schema)JSON schema definition for the 'get-user-info' tool input: an empty object with no properties or required fields.types.Tool( name="get-user-info", description="Get current user's basic info", inputSchema={ "type": "object", "properties": {}, # No parameters needed "required": [], }, ),