Skip to main content
Glama
CoinStatsHQ

CoinStats MCP Server

Official

get-share-token

Retrieve a saved portfolio share token from local cache to access shared cryptocurrency portfolio data in the CoinStats MCP Server.

Instructions

Retrieves the saved portfolio share token from local cache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for the 'get-share-token' tool. It retrieves the share token from the local cache using getFromCache and returns it in the tool response format, or an error message if not found.
    if (config.name === 'get-share-token') {
        const shareToken = await getFromCache('shareToken');
    
        return {
            content: [
                {
                    type: 'text',
                    text: shareToken ? shareToken : 'No share token found in cache',
                    isError: !shareToken,
                },
            ],
        };
    }
  • Tool configuration (ToolConfig) defining the name, description, empty input parameters schema (using Zod), and flags for local execution.
    {
        name: 'get-share-token',
        description: 'Retrieves the saved portfolio share token from local cache.',
        endpoint: '', // Empty string since this is a local operation
        method: 'GET',
        parameters: {},
        isLocal: true, // Flag indicating this is a local operation that doesn't use an API
    },
  • src/index.ts:17-18 (registration)
    Registration of all tools, including 'get-share-token', by passing allToolConfigs to the registerTools function from toolFactory.
    // Register all tools from configurations
    registerTools(server, allToolConfigs);
  • Helper utility function used by the handler to fetch the share token value from the local JSON cache file.
    export async function getFromCache(key: string): Promise<any | undefined> {
        try {
            const cacheData = await readCache();
            return cacheData[key];
        } catch (error) {
            console.error(`Error getting '${key}' from cache:`, error);
            return undefined; // Return undefined on error instead of throwing
        }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states it retrieves from cache without disclosing behavioral traits like error handling (e.g., if cache is empty), performance characteristics, or whether it's read-only. It provides minimal context beyond the basic action.

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 and resource. Every word earns its place with no wasted text, making it highly concise and well-structured for quick understanding.

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 simplicity (0 parameters, no output schema, no annotations), the description is adequate but incomplete. It lacks details on return values (e.g., token format or null cases) and cache behavior, which are important for a retrieval tool despite the low complexity.

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 tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information.

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 ('Retrieves'), resource ('saved portfolio share token'), and location ('from local cache'), distinguishing it from siblings like 'save-share-token' which saves rather than retrieves. It precisely communicates what the tool does without redundancy.

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 by specifying retrieval from local cache, suggesting it's for accessing previously saved tokens. However, it lacks explicit guidance on when to use this versus alternatives like 'save-share-token' or prerequisites for cache availability, leaving some context 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/CoinStatsHQ/coinstats-mcp'

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