Skip to main content
Glama

markitup_credit_balance

Check your MarkItUp credit balance and subscription status to ensure you have available credits before generating marketing visuals.

Instructions

Return the current MarkItUp credit balance and subscription status for the authenticated account. Use this before calling generation tools to verify the account has credits available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The runBalance function executes the tool logic: it calls the API at /credits/balance, formats the response into a human-readable text string, and returns both content and structured data.
    export async function runBalance(api: MarkItUpApiClient): Promise<{
      content: Array<{ type: "text"; text: string }>;
      structuredContent: BalanceResponse;
    }> {
      const data = await api.post<BalanceResponse>("/credits/balance", {});
    
      const lines = [
        `Credit balance: ${data.balance}`,
        data.subscriptionCredits !== undefined
          ? `  • Subscription credits: ${data.subscriptionCredits}`
          : null,
        data.topupCredits !== undefined
          ? `  • Top-up credits: ${data.topupCredits}`
          : null,
        data.subscription
          ? `Subscription: ${data.subscription.planId ?? "unknown"} (${data.subscription.status})`
          : "Subscription: none",
      ].filter((s): s is string => s !== null);
    
      return {
        content: [{ type: "text", text: lines.join("\n") }],
        structuredContent: data,
      };
    }
  • The balanceTool object defines the tool name ('markitup_credit_balance'), description, and inputSchema (empty object with no properties).
    export const balanceTool = {
      name: "markitup_credit_balance",
      description:
        "Return the current MarkItUp credit balance and subscription status for the authenticated account. " +
        "Use this before calling generation tools to verify the account has credits available.",
      inputSchema: {
        type: "object",
        properties: {},
        additionalProperties: false,
      },
    } as const;
  • src/index.ts:41-42 (registration)
    The tool is registered into the tools array for the ListToolsRequestSchema handler.
    const tools: Tool[] = [
      balanceTool as unknown as Tool,
  • src/index.ts:55-56 (registration)
    The tool name is used in a switch-case to dispatch to runBalance when the tool is called.
    case balanceTool.name:
      return await runBalance(api);
  • MarkItUpApiClient.post is used by runBalance to make the HTTP request to the API.
    export class MarkItUpApiClient {
      private apiKey: string;
      private baseUrl: string;
    
      constructor(opts: ApiClientOptions) {
        if (!opts.apiKey) {
          throw new Error("MARKITUP_API_KEY is required");
        }
        this.apiKey = opts.apiKey;
        this.baseUrl = (opts.baseUrl ?? DEFAULT_API_BASE).replace(/\/$/, "");
      }
    
      async post<T>(path: string, body: Record<string, unknown>): Promise<T> {
        return this.request<T>("POST", path, body);
      }
    
      async get<T>(path: string): Promise<T> {
        return this.request<T>("GET", path);
      }
    
      private async request<T>(
        method: "GET" | "POST",
        path: string,
        body?: Record<string, unknown>
      ): Promise<T> {
        const url = `${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
        const res = await fetch(url, {
          method,
          headers: {
            "X-API-Key": this.apiKey,
            "Content-Type": "application/json",
            "User-Agent": "markitup-mcp-server/0.1.0",
          },
          body: body ? JSON.stringify(body) : undefined,
        });
    
        const text = await res.text();
        let parsed: unknown;
        try {
          parsed = text ? JSON.parse(text) : {};
        } catch {
          parsed = { error: text };
        }
    
        if (!res.ok) {
          const errorMessage =
            (parsed as { error?: string }).error ?? `HTTP ${res.status}`;
          throw new MarkItUpApiError(
            humanizeError(res.status, errorMessage),
            res.status,
            codeForStatus(res.status)
          );
        }
    
        const wrapper = parsed as { data?: T };
        return (wrapper.data ?? parsed) as T;
      }
    }
Behavior3/5

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

No annotations are present, so the description carries full burden. It accurately describes the return of balance and status but does not explicitly mention that it is a safe read-only operation or any other behavioral traits like latency.

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?

Two sentences with no redundant information, front-loading the core purpose and immediately following with usage guidance.

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?

Given no parameters, no output schema, and no annotations, the description is sufficient for an agent to understand the tool's function and use case. Could optionally mention that it does not consume credits.

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 tool has no parameters, and the schema coverage is 100% (empty). The description adds meaning by explaining what the return value represents and how to use it, meeting the baseline for no parameters.

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 it returns the credit balance and subscription status for the authenticated account, specifying its purpose as a check before generation tools. This distinguishes it from siblings like markitup_generate.

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

Usage Guidelines5/5

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

Explicitly instructs to use before calling generation tools to verify available credits, providing a clear when-to-use guideline.

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/smythmyke/markitup-mcp-server'

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