Skip to main content
Glama

get_token

Fetch and cache authentication tokens for the ZenTao project management system using account credentials to enable API access.

Instructions

Fetch a token via POST /tokens using env ZENTAO_ACCOUNT/PASSWORD. Caches in-memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceRefreshNoIgnore cached token

Implementation Reference

  • Handler logic for the 'get_token' tool within the CallToolRequestSchema handler. It calls fetchToken with the optional forceRefresh argument and returns the token as a text content block.
    if (name === "get_token") {
      const token = await fetchToken(Boolean(args.forceRefresh));
      return {
        content: [
          {
            type: "text",
            text: `token=${token}`,
          },
        ],
      };
  • Schema definition for the 'get_token' tool, including name, description, and input schema (with optional forceRefresh boolean). Registered in ListToolsRequestSchema response.
    {
      name: "get_token",
      description: "Fetch a token via POST /tokens using env ZENTAO_ACCOUNT/PASSWORD. Caches in-memory.",
      inputSchema: {
        type: "object",
        properties: {
          forceRefresh: { type: "boolean", description: "Ignore cached token" },
        },
        required: [],
        additionalProperties: false,
      },
    },
  • Core helper function that implements the token fetching logic: checks cache, asserts config, POSTs to /tokens endpoint with account/password, parses response, caches and returns the token.
    async function fetchToken(forceRefresh = false) {
      if (cachedToken && !forceRefresh) return cachedToken;
      assertConfig();
      const url = `${baseUrl}/api.php/v1/tokens`;
      const res = await fetch(url, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ account, password }),
      });
      const text = await res.text();
      if (!res.ok) throw new Error(`Token request failed: ${res.status} ${text}`);
      const data = safeJson(text);
      if (!data?.token) throw new Error("Token missing in response");
      cachedToken = data.token;
      return cachedToken;
    }
Behavior4/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 effectively describes key traits: it performs a POST request (implying a write operation), requires specific environment variables for authentication, and caches tokens in-memory. It also hints at the 'forceRefresh' parameter's purpose. However, it lacks details on error handling, rate limits, or token expiration, which could be important for an authentication tool.

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 front-loaded and highly concise, consisting of a single sentence that efficiently conveys the action, method, authentication, and caching. Every word earns its place, with no redundant information, making it easy to parse 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 complexity (authentication with caching) and no annotations or output schema, the description is somewhat complete but has gaps. It covers the main action, authentication method, and caching, but lacks details on response format, error cases, or how the token is used by sibling tools. For a tool that likely provides critical auth tokens, more context on integration would be beneficial.

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 100% description coverage, with the 'forceRefresh' parameter documented as 'Ignore cached token'. The description adds value by mentioning caching ('Caches in-memory'), which contextualizes the parameter's purpose. Since there is only one parameter and schema coverage is high, the description compensates well, but it could explicitly link 'forceRefresh' to the caching behavior for clarity.

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 specific action ('Fetch a token') and the resource ('via POST /tokens'), distinguishing it from sibling tools like 'getBugDetail' or 'searchProducts' that handle different resources. It specifies the authentication method ('using env ZENTAO_ACCOUNT/PASSWORD') and caching behavior, making the purpose explicit and distinct.

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 context by mentioning authentication via environment variables and caching, suggesting this tool is for obtaining tokens needed for other operations. However, it does not explicitly state when to use it versus alternatives (e.g., whether other tools require tokens) or provide exclusions, leaving some guidance gaps.

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

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