Skip to main content
Glama

AI Humanizer MCP Server

by Text2Go

detect

Identify AI-generated text using advanced detection methods like COPYLEAKS and HEMINGWAY. Generates task details for transparency and provides a task-specific URL for detailed analysis.

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

NameRequiredDescriptionDefault
detectionTypeListYes
textYes
typeYes

Input Schema (JSON Schema)

{ "properties": { "detectionTypeList": { "items": { "enum": [ "COPYLEAKS", "HEMINGWAY" ], "type": "string" }, "type": "array" }, "text": { "type": "string" }, "type": { "enum": [ "original_text" ], "type": "string" } }, "required": [ "type", "text", "detectionTypeList" ], "type": "object" }

Implementation Reference

  • The execution handler for the 'detect' tool. It validates input using AiDetectArgumentSchema, calls the external API for AI text detection, and formats the response.
    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 {
  • JSON Schema definition for the 'detect' tool input, provided in tool registration.
    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 used internally to parse and validate arguments for the 'detect' tool.
    const AiDetectArgumentSchema = z .object({ type: z.enum(["original_text"]), text: z.string(), detectionTypeList: z.array( z.enum(["COPYLEAKS", "HEMINGWAY"]) ), }) .required();
  • src/index.ts:35-64 (registration)
    Registration of the 'detect' tool in the ListToolsRequestSchema handler, including its name, description, and 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"], }, } ], }; });
  • Utility function used by the detect handler to make POST requests to the detection 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; } }

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

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