Skip to main content
Glama

get_me

Retrieve the authenticated user's profile information from HackMD, including account details and settings, to verify identity or access user-specific data.

Instructions

Get current user profile

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for 'get_me' tool — calls hackmdFetch('/me') to retrieve the current user's profile and wraps the result in a success/error response.
    server.tool("get_me", "Get current user profile", {}, async () => {
      try {
        return success(await hackmdFetch("/me"));
      } catch (e) {
        return error((e as Error).message);
      }
    });
  • src/tools.ts:6-15 (registration)
    Tool registration — registerTools() registers all tools including 'get_me' on the MCP server. The tool has no input parameters (empty schema) and returns the user profile.
    export function registerTools(server: McpServer) {
      // ── User ──────────────────────────────────────────────
    
      server.tool("get_me", "Get current user profile", {}, async () => {
        try {
          return success(await hackmdFetch("/me"));
        } catch (e) {
          return error((e as Error).message);
        }
      });
  • hackmdFetch helper — generic API fetch function used by 'get_me' handler to make authenticated GET requests to the HackMD API.
    export async function hackmdFetch(
      path: string,
      options: { method?: string; body?: unknown } = {}
    ): Promise<unknown> {
      const { method = "GET", body } = options;
      const token = getToken();
    
      const res = await fetch(`${API_BASE}${path}`, {
        method,
        headers: {
          Authorization: `Bearer ${token}`,
          ...(body ? { "Content-Type": "application/json" } : {}),
        },
        ...(body ? { body: JSON.stringify(body) } : {}),
      });
    
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(`HackMD API ${method} ${path} → ${res.status}: ${text}`);
      }
    
      if (res.status === 204) return { success: true };
      if (res.status === 202) return { success: true, status: "accepted" };
    
      return res.json();
    }
  • success() and error() helpers — format tool responses. 'get_me' uses both to wrap data or errors into MCP text content format.
    export function success(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
    
    export function error(message: string) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify({ error: message }) }],
        isError: true as const,
      };
    }
  • Input schema for 'get_me' — an empty Zod object ({}) meaning the tool takes no parameters.
    server.tool("get_me", "Get current user profile", {}, async () => {
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description adequately implies read-only retrieval of user profile. Does not detail if authorization is needed or output structure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no unnecessary words. Perfectly concise for a zero-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Describes core functionality adequately. Lacks explicit mention that it retrieves the authenticated user's profile and what fields are returned, but sufficient for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist; schema coverage is trivially 100%. Description adds no param details, but none are needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Get' and resource 'current user profile', clearly distinguishing from sibling tools focused on notes and teams.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. However, the purpose is self-explanatory given no other tool retrieves user profile.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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