Skip to main content
Glama
chongzixuan-ai

AI Humanizer MCP Server

detect

Identify AI-generated text using detection tools and provide detailed analysis results through a task-specific URL.

Instructions

Detect whether the text is AI-generated.Show to user the task detail url. Extract the taskId field, then concatenate the link in the following format: https://pre-www.text2go.ai/?utm_source=claude_mcp&taskId={taskId}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes
textYes
detectionTypeListYes

Implementation Reference

  • Handler for the 'detect' tool: parses input arguments using Zod schema, sends POST request to AI detection API endpoint, handles response or error, and returns JSON stringified result.
    if (name === "detect") {
      const argument = AiDetectArgumentSchema.parse(args);
    
      const detectUrl = `${API_BASE}/rewrite/text-detection`;
      const detectData = await makeRequest<AiDetectResponse>(detectUrl, argument);
    
      if (!detectData) {
        return {
          content: [
            {
              type: "text",
              text: "Failed to retrieve alerts data",
            },
          ],
        };
      }
    
      const responseData = {
        ...detectData
        ,text: undefined,
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(responseData),
          },
        ],
      };
    } else {
  • src/index.ts:35-64 (registration)
    Registration of the 'detect' tool in the ListToolsRequestSchema handler, defining name, description, and JSON input schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
            {
                name: "detect",
                description: "Detect whether the text is AI-generated.Show to user the task detail url. Extract the taskId field, then concatenate the link in the following format: https://pre-www.text2go.ai/?utm_source=claude_mcp&taskId={taskId}",
                inputSchema: {
                  type: "object",
                  properties: {
                    type: {
                      type: "string",
                      enum: ["original_text"],
                    },
                    text: {
                      type: "string",
                    },
                    detectionTypeList: {
                      type: "array",
                      items: {
                        type: "string",
                        enum: ["COPYLEAKS", "HEMINGWAY"],
                      },
                    },
                  },
                  required: ["type", "text", "detectionTypeList"],
                },
              }
        ],
      };
    });
  • Zod schema (AiDetectArgumentSchema) for validating and parsing the input arguments to the 'detect' tool handler.
    const AiDetectArgumentSchema = z
      .object({
        type: z.enum(["original_text"]),
        text: z.string(),
        detectionTypeList: z.array(
          z.enum(["COPYLEAKS", "HEMINGWAY"])
        ),
      })
      .required();
  • Helper function 'makeRequest' used by the 'detect' handler to perform POST requests to the external API.
    async function makeRequest<T>(url: string, data?: any): Promise<T | null> {
      const headers = {
        "User-Agent": USER_AGENT,
        "Accept": "application/json",
        "Content-Type": "application/json"
      };
    
      try {
        const response = await fetch(url, {
          method: 'POST',
          headers,
          body: data ? JSON.stringify(data) : undefined
        });
        
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        return (await response.json()) as T;
      } catch (error) {
        console.error("Error making request:", error);
        return null;
      }
    }

Tool Definition Quality

Score is being calculated. Check back soon.

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

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