Skip to main content
Glama
louis030195

GPTZero MCP Server

by louis030195

gptzero_detect

Analyze text to detect AI-generated content and get probability scores for AI, human, or mixed authorship with multilingual support.

Instructions

Detect if text was generated by AI. Returns probability scores for AI, human, and mixed content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentYesThe text document you want to analyze for AI detection
multilingualNoEnable multilingual detection (supports French and Spanish)

Implementation Reference

  • Handler function for the gptzero_detect tool. Parses input arguments using DetectTextSchema, calls GPTZeroClient.detectText, extracts key metrics, and returns formatted text response with AI detection results.
    case "gptzero_detect": {
      const { document, multilingual } = DetectTextSchema.parse(args);
    
      const result = await client.detectText(document, multilingual);
    
      // Extract key metrics from the first document
      const doc = result.documents[0];
      const summary = {
        predicted_class: doc.predicted_class,
        confidence: doc.confidence_category,
        probabilities: doc.class_probabilities,
        result_message: doc.result_message,
        average_generated_prob: doc.average_generated_prob,
        completely_generated_prob: doc.completely_generated_prob,
      };
    
      return {
        content: [
          {
            type: "text",
            text: `AI Detection Result:\n\n` +
                  `Prediction: ${summary.predicted_class}\n` +
                  `Confidence: ${summary.confidence}\n` +
                  `Message: ${summary.result_message}\n\n` +
                  `Probabilities:\n` +
                  `- AI: ${(summary.probabilities.ai * 100).toFixed(1)}%\n` +
                  `- Human: ${(summary.probabilities.human * 100).toFixed(1)}%\n` +
                  `- Mixed: ${(summary.probabilities.mixed * 100).toFixed(1)}%\n\n` +
                  `Full analysis:\n${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • src/index.ts:69-87 (registration)
    Registration of the gptzero_detect tool in the ListTools response, including name, description, and input schema definition.
    {
      name: "gptzero_detect",
      description: "Detect if text was generated by AI. Returns probability scores for AI, human, and mixed content.",
      inputSchema: {
        type: "object",
        properties: {
          document: {
            type: "string",
            description: "The text document you want to analyze for AI detection",
          },
          multilingual: {
            type: "boolean",
            description: "Enable multilingual detection (supports French and Spanish)",
            default: false,
          },
        },
        required: ["document"],
      },
    },
  • Zod schema validator for gptzero_detect input parameters, used in the handler to parse and validate arguments.
    const DetectTextSchema = z.object({
      document: z.string().describe("The text document you want to analyze for AI detection"),
      multilingual: z.boolean().optional().default(false).describe("Enable multilingual detection (supports French and Spanish)"),
    });
  • GPTZeroClient class providing API client for GPTZero with detectText method that performs the core AI detection API call used by the gptzero_detect handler.
    class GPTZeroClient {
      private api: AxiosInstance;
    
      constructor(apiKey: string) {
        this.api = axios.create({
          baseURL: "https://api.gptzero.me/v2",
          headers: {
            "x-api-key": apiKey,
            "Content-Type": "application/json",
          },
        });
      }
    
      async detectText(document: string, multilingual = false) {
        const response = await this.api.post("/predict/text", {
          document,
          multilingual,
        });
        return response.data;
      }
    
      async getModelVersions() {
        const response = await this.api.get("/model-versions/ai-scan");
        return response.data;
      }
    }
Behavior2/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 of behavioral disclosure. It mentions the return values (probability scores) but lacks details on accuracy, limitations, rate limits, or authentication needs. For a detection tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that front-loads the core purpose and output without any wasted words. It is appropriately sized for the tool's complexity, making it easy to understand quickly.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and output but lacks behavioral context and usage guidelines. Without an output schema, it should ideally explain return values more, but the mention of probability scores provides some compensation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description does not add any meaning beyond what the schema provides, such as explaining the implications of the 'multilingual' parameter or providing examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose with a specific verb ('Detect') and resource ('text generated by AI'), and it distinguishes from the sibling tool 'gptzero_model_versions' by focusing on detection rather than model version management. It specifies the output ('probability scores for AI, human, and mixed content'), making the purpose explicit and differentiated.

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 for analyzing text for AI detection, but it does not provide explicit guidance on when to use this tool versus alternatives or any exclusions. No context is given about scenarios where it might be preferred over other methods, leaving usage to inference based on the purpose alone.

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/louis030195/gptzero-mcp'

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