Skip to main content
Glama

Get Credits

get_credits

Check your credit balance and available scan tiers with pricing to launch penetration tests in TurboPentest.

Instructions

Check your credit balance and available scan tiers with pricing. Credits are required to launch pentests.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that fetches credit balance and tier information, formats it into a text summary, and returns it.
    async () => {
      try {
        const [balance, tiersData] = await Promise.all([
          client.getCreditBalance(),
          client.getCreditTiers(),
        ]);
    
        const lines = [
          "--- Credit Balance ---",
          `  Available: ${balance.available}`,
          `  Used:      ${balance.used}`,
          `  Scheduled: ${balance.scheduled}`,
          `  Expired:   ${balance.expired}`,
        ];
    
        if (balance.expiringSoon > 0) {
          lines.push(`  Expiring soon (30 days): ${balance.expiringSoon}`);
        }
    
        lines.push(
          "",
          "  Available by tier:",
          `    Recon:    ${balance.byTier.recon || 0}`,
          `    Standard: ${balance.byTier.standard || 0}`,
          `    Deep:     ${balance.byTier.deep || 0}`,
          `    Blitz:    ${balance.byTier.blitz || 0}`,
          "",
          "--- Available Tiers ---",
        );
    
        for (const tier of tiersData.tiers ?? []) {
          lines.push(
            `  ${tier.label} ($${(tier.priceCents / 100).toFixed(0)})`,
            `    Agents: ${tier.agents}, Duration: ${tier.durationMin}min, Agent-hours: ${tier.agentHours}`,
          );
        }
    
        if ((tiersData.volumeDiscounts ?? []).length > 0) {
          lines.push("", "  Volume discounts:");
          for (const d of tiersData.volumeDiscounts ?? []) {
            lines.push(`    ${d.minQuantity}+ credits: ${d.discountPercent}% off`);
          }
        }
    
        return { content: [{ type: "text" as const, text: lines.join("\n") }] };
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: "text" as const, text: `Failed to get credits: ${message}` }],
          isError: true,
        };
      }
    },
  • The registration of the 'get_credits' tool within the MCP server, defining its schema and handler.
    server.registerTool(
      "get_credits",
      {
        title: "Get Credits",
        description:
          "Check your credit balance and available scan tiers with pricing. " +
          "Credits are required to launch pentests.",
        inputSchema: z.object({}),
      },
      async () => {
        try {
          const [balance, tiersData] = await Promise.all([
            client.getCreditBalance(),
            client.getCreditTiers(),
          ]);
    
          const lines = [
            "--- Credit Balance ---",
            `  Available: ${balance.available}`,
            `  Used:      ${balance.used}`,
            `  Scheduled: ${balance.scheduled}`,
            `  Expired:   ${balance.expired}`,
          ];
    
          if (balance.expiringSoon > 0) {
            lines.push(`  Expiring soon (30 days): ${balance.expiringSoon}`);
          }
    
          lines.push(
            "",
            "  Available by tier:",
            `    Recon:    ${balance.byTier.recon || 0}`,
            `    Standard: ${balance.byTier.standard || 0}`,
            `    Deep:     ${balance.byTier.deep || 0}`,
            `    Blitz:    ${balance.byTier.blitz || 0}`,
            "",
            "--- Available Tiers ---",
          );
    
          for (const tier of tiersData.tiers ?? []) {
            lines.push(
              `  ${tier.label} ($${(tier.priceCents / 100).toFixed(0)})`,
              `    Agents: ${tier.agents}, Duration: ${tier.durationMin}min, Agent-hours: ${tier.agentHours}`,
            );
          }
    
          if ((tiersData.volumeDiscounts ?? []).length > 0) {
            lines.push("", "  Volume discounts:");
            for (const d of tiersData.volumeDiscounts ?? []) {
              lines.push(`    ${d.minQuantity}+ credits: ${d.discountPercent}% off`);
            }
          }
    
          return { content: [{ type: "text" as const, text: lines.join("\n") }] };
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error);
          return {
            content: [{ type: "text" as const, text: `Failed to get credits: ${message}` }],
            isError: true,
          };
        }
      },
    );
  • The input schema for the 'get_credits' tool, which takes no arguments (empty object).
    inputSchema: z.object({}),
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates this is a read operation ('check') and mentions the purpose of credits for launching pentests, adding useful context. However, it doesn't disclose details like authentication needs, rate limits, or error handling, which are important for a tool that interacts with billing or resource systems.

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 appropriately sized and front-loaded, consisting of two concise sentences that directly state the tool's function and its relevance to pentests. Every sentence earns its place by adding clear information without redundancy or unnecessary details.

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 the tool's low complexity (0 parameters, no output schema, no annotations), the description is complete enough for basic understanding. It explains what the tool does and why it matters, though it could benefit from more behavioral details (e.g., response format or error cases) to fully compensate for the lack of structured data.

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 adds value by explaining the semantic output ('credit balance and available scan tiers with pricing'), which compensates for the lack of an output schema. This goes beyond the schema, providing meaningful context for what the tool returns.

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

Purpose4/5

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

The description clearly states the tool's purpose with specific verbs ('check', 'launch') and resources ('credit balance', 'available scan tiers with pricing', 'pentests'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'list_pentests' or 'get_pentest', which might also relate to pentest operations but focus on different aspects.

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 stating 'Credits are required to launch pentests,' suggesting this tool should be used before starting a pentest to check resource availability. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., no comparison to sibling tools) or any exclusions, leaving some ambiguity in context.

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/IntegSec/turbopentest-mcp'

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