Skip to main content
Glama
CoinStatsHQ

CoinStats MCP Server

Official

save-share-token

Store portfolio share tokens locally to maintain access across sessions for tracking cryptocurrency investments.

Instructions

Saves the provided portfolio share token to a local cache for future use across sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shareTokenYesThe portfolio share token to save locally.

Implementation Reference

  • The handler function specifically for the 'save-share-token' tool. It calls saveToCache to store the shareToken in local cache and returns a success message.
    if (config.name === 'save-share-token') {
        await saveToCache('shareToken', params.shareToken);
        return {
            content: [
                {
                    type: 'text',
                    text: 'Share token saved successfully',
                },
            ],
        };
    }
  • Tool configuration and Zod schema defining the input parameters (shareToken) for the 'save-share-token' tool, marked as a local operation.
    {
        name: 'save-share-token',
        description: 'Saves the provided portfolio share token to a local cache for future use across sessions.',
        // This tool operates locally and does not call an external API endpoint.
        // The logic to call saveToCache('shareToken', shareToken) will be handled
        // by the tool execution mechanism based on this tool's name.
        endpoint: '', // Empty string since this is a local operation
        method: 'POST', // Using POST since we're saving data
        parameters: {
            shareToken: z.string().describe('The portfolio share token to save locally.'),
        },
        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 'save-share-token', by calling registerTools with the allToolConfigs array which contains its configuration.
    // Register all tools from configurations
    registerTools(server, allToolConfigs);
  • Helper function saveToCache used by the tool handler to persist the shareToken to a local JSON cache file.
    export async function saveToCache(key: string, value: any): Promise<void> {
        try {
            const cacheData = await readCache();
            cacheData[key] = value;
            await fs.writeFile(cacheFilePath, JSON.stringify(cacheData, null, 2), 'utf-8');
        } catch (error) {
            console.error(`Error saving '${key}' to 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 the basic action. It doesn't disclose important behavioral traits like whether this requires specific permissions, what format the cache uses, if it overwrites existing tokens, or potential error conditions. The description is minimal for a tool that modifies local state.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple tool with one parameter and is front-loaded with the essential information.

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?

For a tool with no annotations and no output schema, the description is adequate but minimal. It covers the basic purpose and caching behavior, but doesn't address important context like what 'local cache' means, how tokens are retrieved later, or what happens on failure. The simplicity of the tool (1 parameter, no complex schema) makes this somewhat acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single parameter 'shareToken' well-documented in the schema. The description adds no additional parameter information beyond what's already in the structured schema, so it meets the baseline for high schema coverage.

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 ('saves') and resource ('portfolio share token') with precise scope ('to a local cache for future use across sessions'). It distinguishes from sibling tools like 'get-share-token' by focusing on persistence rather than retrieval.

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

Usage Guidelines4/5

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

The description implies usage context ('for future use across sessions') suggesting this tool should be used when a token needs to be cached for later access. However, it doesn't explicitly state when NOT to use it or name alternatives like 'get-share-token' for obtaining tokens initially.

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