Skip to main content
Glama
trainual

Tiptap Collaboration MCP Server

by trainual

get_server_statistics

Retrieve server-wide metrics such as total documents, active connections, and usage statistics to monitor and manage Tiptap collaborative document services efficiently.

Instructions

Get server-wide statistics including total documents, connections, and usage metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that fetches server statistics via API call to /api/statistics, formats the response as text content, and handles errors gracefully.
    async () => {
      try {
        const headers: Record<string, string> = {
          'User-Agent': 'tiptap-collaboration-mcp',
          'Content-Type': 'application/json',
        };
    
        const token = getToken();
        if (token) headers['Authorization'] = token;
    
        const response = await fetch(`${getBaseUrl()}/api/statistics`, { headers });
    
        if (!response.ok) {
          return {
            content: [
              {
                type: 'text',
                text: `Failed to retrieve server statistics. HTTP error: ${response.status} ${response.statusText}`,
              },
            ],
          };
        }
    
        const statistics = await response.json();
    
        return {
          content: [
            {
              type: 'text',
              text: `Server Statistics: ${JSON.stringify(statistics, null, 2)}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error retrieving server statistics: ${
                error instanceof Error ? error.message : 'Unknown error'
              }`,
            },
          ],
        };
      }
  • Registers the "get-server-statistics" tool on the MCP server using server.tool(), with tool name, description, empty schema, and handler function.
    server.tool(
      'get-server-statistics',
      'Get server-wide statistics including total documents, connections, and usage metrics',
      {},
      async () => {
        try {
          const headers: Record<string, string> = {
            'User-Agent': 'tiptap-collaboration-mcp',
            'Content-Type': 'application/json',
          };
    
          const token = getToken();
          if (token) headers['Authorization'] = token;
    
          const response = await fetch(`${getBaseUrl()}/api/statistics`, { headers });
    
          if (!response.ok) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Failed to retrieve server statistics. HTTP error: ${response.status} ${response.statusText}`,
                },
              ],
            };
          }
    
          const statistics = await response.json();
    
          return {
            content: [
              {
                type: 'text',
                text: `Server Statistics: ${JSON.stringify(statistics, null, 2)}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error retrieving server statistics: ${
                  error instanceof Error ? error.message : 'Unknown error'
                }`,
              },
            ],
          };
        }
      }
    );
  • Empty input schema indicating the tool takes no parameters.
    {},
  • src/server.ts:55-55 (registration)
    Calls the registration function for get_server_statistics tool during main server setup.
    registerGetServerStatistics(server, getBaseUrl, getToken);
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 states the tool retrieves statistics but does not specify whether this is a read-only operation, requires permissions, has rate limits, or details the response format. This is inadequate for a tool with zero annotation coverage.

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 key action ('Get server-wide statistics') and provides relevant examples without unnecessary details. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what the statistics include beyond vague examples, how they are formatted, or any behavioral traits like safety or performance. For a tool with no structured data, more context is needed to guide the agent effectively.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose. A baseline of 4 is applied as it meets expectations for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 specific verbs ('Get') and resources ('server-wide statistics'), including examples of what statistics are retrieved ('total documents, connections, and usage metrics'). However, it does not explicitly distinguish this tool from its sibling 'get_document_statistics', which might cause confusion about scope differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'get_document_statistics' for document-specific stats or 'get_collaboration_health' for related metrics, leaving the agent without context for tool selection.

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

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/trainual/tiptap-collaboration-mcp'

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