Skip to main content
Glama

get_user_info

Retrieve detailed information about the authenticated user to enable personalized interactions within the HackMD platform.

Instructions

Get information about the authenticated user

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The handler function for the 'get_user_info' tool. It fetches the authenticated user's information using the HackMD API client, formats it as pretty-printed JSON text, and returns it in MCP content format. Includes error handling to return an error message if the API call fails.
    async () => { try { const userInfo = await client.getMe(); return { content: [ { type: "text", text: JSON.stringify(userInfo, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
  • tools/profile.ts:7-33 (registration)
    Registers the 'get_user_info' tool on the MCP server using server.tool(). Specifies the tool name, description, empty input schema ({}), metadata hints, and attaches the inline handler function.
    "get_user_info", "Get information about the authenticated user", {}, { title: "Get user information", readOnlyHint: true, openWorldHint: true, }, async () => { try { const userInfo = await client.getMe(); return { content: [ { type: "text", text: JSON.stringify(userInfo, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );

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/yuna0x0/hackmd-mcp'

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