Skip to main content
Glama

getCurrentUser

Retrieve current user information from the Directus CMS API by providing the API URL and authentication token, simplifying user management through the Directus MCP Server.

Instructions

Get the current user info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenNoAuthentication token (default from config)
urlNoDirectus API URL (default from config)

Implementation Reference

  • index.ts:440-457 (registration)
    Registration of the 'getCurrentUser' tool in the listTools response, including its input schema definition.
    { name: "getCurrentUser", description: "Get the current user info", inputSchema: { type: "object", properties: { url: { type: "string", description: "Directus API URL (default from config)" }, token: { type: "string", description: "Authentication token (default from config)" } }, required: [] } },
  • Handler implementation for 'getCurrentUser' tool. Fetches current user info from Directus API endpoint '/users/me' using axios GET request with bearer token authentication.
    case "getCurrentUser": { const token = toolArgs.token || CONFIG.DIRECTUS_ACCESS_TOKEN; const response = await axios.get( `${url}/users/me`, { headers: buildHeaders(token) } ); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2) } ] }; }

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/pixelsock/directus-mcp'

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