Skip to main content
Glama
recraft-ai

Recraft AI MCP Server

Official

get_user

Retrieve detailed information about the current Recraft API user, including email, name, and credit balance, for seamless integration and account management.

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 for the 'get_user' tool. It retrieves the current user's information (email, name, credits) via the Recraft API and returns a formatted text response, including a warning if credits are low.
    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
        }
      }
    }
  • Tool schema definition including name, description, and 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-82 (registration)
    Registration of the getUserTool in the list of available tools returned by ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          generateImageTool,
          createStyleTool,
          vectorizeImageTool,
          imageToImageTool,
          removeBackgroundTool,
          replaceBackgroundTool,
          crispUpscaleTool,
          creativeUpscaleTool,
          getUserTool,
        ],
      }
    })
  • src/index.ts:118-119 (registration)
    Dispatch/registration of the getUserHandler in the switch statement for CallToolRequestHandler.
    case getUserTool.name:
      return await getUserHandler(recraftServer, args ?? {})
  • src/index.ts:20-20 (registration)
    Import of getUserTool and getUserHandler from the implementation file.
    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 retrieves user information, implying a read-only operation, but does not mention behavioral traits like authentication requirements, rate limits, or error handling. The description is accurate but lacks depth for a tool with no annotation support.

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 efficiently conveys the tool's purpose, resource, and specific data returned. It is front-loaded with the main action and includes no redundant information, making it highly concise and effective.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is complete enough for basic understanding. However, it lacks details on output format (e.g., structure of returned data) and behavioral context (e.g., authentication needs), which could be important for an AI agent despite the tool's straightforward nature.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose. This meets the baseline for tools with no parameters, as it avoids unnecessary details.

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 specific action ('Get information') and resource ('current Recraft API user'), with explicit details about what information is retrieved ('their email, name, and credit balance'). It distinguishes this tool from all sibling tools, which are focused on image manipulation rather than user information retrieval.

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?

The description implies usage by specifying 'current Recraft API user,' suggesting it should be used to retrieve the authenticated user's details. However, it does not provide explicit guidance on when to use this tool versus alternatives (e.g., if there were other user-related tools) or any exclusions. Since sibling tools are unrelated, this is adequate but not comprehensive.

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

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

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