Skip to main content
Glama
recraft-ai

Recraft AI MCP Server

Official

get_user

Retrieve your Recraft account details: email, name, and credit balance.

Instructions

Get information about the current Recraft API user (their email, name, and credit balance).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_user tool logic. Calls server.api.userApi.getCurrentUser() and returns the user's email, name, and credit balance with a low-credit warning if applicable.
    export const getUserHandler = async (server: RecraftServer, _args: Record<string, unknown>): Promise<CallToolResult> => {
      try {
        const result = await server.api.userApi.getCurrentUser()
    
        return {
          content: [
            {
              type: 'text',
              text: `User email: ${result.email}, name: ${result.name}.\nYou have ${result.credits} credits left.` + 
              (
                result.credits >= ALMOST_ZERO_CREDITS ? 
                "" :
                `\nYou are ${result.credits > 0 ? "almost" : ""} out of credits. Please top up your account on https://www.recraft.ai/profile/api.`
              )
            },
          ]
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Get user error: ${error}`
            }
          ],
          isError: true
        }
      }
    }
  • The tool definition and input schema for get_user. Defines name as 'get_user', a description, and an empty input schema (no parameters required).
    export const getUserTool = {
      name: "get_user",
      description: "Get information about the current Recraft API user (their email, name, and credit balance).",
      inputSchema: {
        type: "object",
        properties: {
        },
        required: []
      }
    }
  • src/index.ts:68-79 (registration)
    Registration of get_user tool in the ListToolsRequestSchema handler, adding getUserTool to the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          generateImageTool,
          createStyleTool,
          vectorizeImageTool,
          imageToImageTool,
          removeBackgroundTool,
          replaceBackgroundTool,
          crispUpscaleTool,
          creativeUpscaleTool,
          getUserTool,
  • src/index.ts:118-119 (registration)
    Routing of the get_user tool call to its handler in the CallToolRequestSchema switch statement.
    case getUserTool.name:
      return await getUserHandler(recraftServer, args ?? {})
  • src/index.ts:20-20 (registration)
    Import of getUserHandler and getUserTool from the GetUser module.
    import { getUserHandler, getUserTool } from "./tools/GetUser"
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool returns user information (non-destructive), but lacks details about authentication requirements, rate limits, or error conditions. As a simple read operation, this is adequate but not fully transparent.

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?

The description is a single, well-structured sentence that front-loads the verb and resource. Every word is necessary and no information is redundant.

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

Completeness5/5

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

The tool has no output schema, but the description lists all returned fields (email, name, credit balance). For a simple retrieval of a single entity, this is complete and sufficient for an agent to understand the tool's output.

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?

The input schema has no parameters (schema coverage 100% vacuously). Per guidelines, 0 parameters yields a baseline of 4. The description does not need to add meaning as there are no parameters to clarify.

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?

The description clearly states the verb 'Get', the resource 'current Recraft API user', and specifies the returned fields (email, name, credit balance). It is distinct from sibling tools which focus on generation and image manipulation.

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

Usage Guidelines4/5

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

The description clearly indicates when to use this tool (to get current user info) but does not explicitly mention when not to use it or provide alternatives. Given the sibling tools are unrelated, this is a minor gap.

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/recraft-ai/mcp-recraft-server'

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