Skip to main content
Glama

call

Execute ZenTao RESTful API calls to manage projects, track bugs, and handle product data with automatic token authentication.

Instructions

Call any ZenTao RESTful API endpoint (api.php/v1). Automatically injects Token header. Paths accept leading slash or relative.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRelative path, e.g. /projects or projects/1
methodNoHTTP verbGET
queryNoQuery params object
bodyNoJSON body
forceTokenRefreshNoRefresh token before request

Implementation Reference

  • Specific handler logic for the 'call' tool within the MCP CallToolRequestSchema handler. Extracts arguments and delegates to callZenTao helper.
    if (name === "call") { const { path, method = "GET", query, body, forceTokenRefresh = false } = args; if (!path) throw new Error("path is required"); const response = await callZenTao({ path, method, query, body, forceTokenRefresh, }); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
  • Core implementation of the API call to ZenTao, handling authentication token, URL building, HTTP request, and response parsing.
    async function callZenTao({ path, method = "GET", query, body, headers = {}, forceTokenRefresh = false, }) { assertConfig(); const token = await fetchToken(forceTokenRefresh); const url = buildUrl(path, query); const res = await fetch(url, { method, headers: { "Content-Type": "application/json", Token: token, ...headers, }, body: body ? JSON.stringify(body) : undefined, }); const text = await res.text(); const data = safeJson(text); if (!res.ok) { throw new Error( `Request failed ${res.status}: ${text || res.statusText || "unknown"}` ); } return { status: res.status, headers: Object.fromEntries(res.headers.entries()), data: data ?? text, }; }
  • Tool registration in the tools/list response, defining name, description, and input schema for the 'call' tool.
    { name: "call", description: "Call any ZenTao RESTful API endpoint (api.php/v1). Automatically injects Token header. Paths accept leading slash or relative.", inputSchema: { type: "object", properties: { path: { type: "string", description: "Relative path, e.g. /projects or projects/1" }, method: { type: "string", description: "HTTP verb", enum: ["GET", "POST", "PUT", "PATCH", "DELETE"], default: "GET", }, query: { type: "object", description: "Query params object", additionalProperties: true }, body: { type: "object", description: "JSON body", additionalProperties: true }, forceTokenRefresh: { type: "boolean", description: "Refresh token before request", }, }, required: ["path"], additionalProperties: false, }, },
  • Input schema definition for the 'call' tool, specifying parameters like path, method, query, body.
    inputSchema: { type: "object", properties: { path: { type: "string", description: "Relative path, e.g. /projects or projects/1" }, method: { type: "string", description: "HTTP verb", enum: ["GET", "POST", "PUT", "PATCH", "DELETE"], default: "GET", }, query: { type: "object", description: "Query params object", additionalProperties: true }, body: { type: "object", description: "JSON body", additionalProperties: true }, forceTokenRefresh: { type: "boolean", description: "Refresh token before request", }, }, required: ["path"], additionalProperties: false, },

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/Valiant-Cat/zentao-mcp-server'

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