Skip to main content
Glama
kinmeic

Stock MCP Server

by kinmeic

watch_get

Retrieve real-time data for a specific stock by entering its code and market to monitor individual positions in A-shares, Hong Kong, or US markets.

Instructions

获取单个观察股票

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes股票代码
marketYes市场

Implementation Reference

  • The getWatch function implementation that loads the watch list and finds a single watch item by code and market
    // 获取单个观察股票
    export function getWatch(code: string, market: Market): WatchItem | null {
      const watchList = loadWatchList();
      return watchList.find(item => item.code === code && item.market === market) || null;
    }
  • src/index.ts:252-263 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining watch_get with name, description, and inputSchema
    {
      name: 'watch_get',
      description: '获取单个观察股票',
      inputSchema: {
        type: 'object',
        properties: {
          code: { type: 'string', description: '股票代码' },
          market: { type: 'string', enum: ['sh', 'sz', 'hk', 'us'], description: '市场' },
        },
        required: ['code', 'market'],
      },
    },
  • The MCP tool request handler for watch_get that parses arguments, calls watch.getWatch(), and returns the result
    if (name === 'watch_get') {
      const params = GetWatchSchema.parse(args);
      const result = watch.getWatch(params.code, params.market as Market);
      if (!result) {
        throw new Error('Watch item not found');
      }
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Zod schema for validating watch_get input parameters (code and market)
    const GetWatchSchema = z.object({
      code: z.string().describe('股票代码'),
      market: z.enum(['sh', 'sz', 'hk', 'us']).describe('市场'),
    });
  • WatchItem interface defining the structure of watch list items returned by watch_get
    // 观察股票信息
    export interface WatchItem {
      code: string;
      name: string;
      reason: string;
      market: Market;
      createdAt: string;
    }
Behavior2/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 states the action ('获取' - get) but doesn't describe what '获取' entails (e.g., returns current price, watch status, or other details), error handling (e.g., if the stock isn't in the watchlist), or any side effects. This leaves significant gaps for a tool that likely interacts with user data.

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 with zero waste. It's appropriately sized for a simple retrieval tool and front-loads the core purpose without unnecessary elaboration.

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 tool's likely complexity (interacting with user watchlists), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what data is returned (e.g., stock details, watch metadata), potential errors, or how it differs from stock_get. For a user-specific operation, more context is needed.

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 both parameters clearly documented in the schema (code and market with enum values). The description adds no additional parameter semantics beyond what the schema provides, such as format examples for 'code' or context for 'market' selection. Baseline 3 is appropriate as the schema does the heavy lifting.

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 purpose as retrieving a single watched stock, with specific verb '获取' (get) and resource '观察股票' (watched stock). It distinguishes from siblings like watch_list (which retrieves multiple) and watch_add/watch_remove (which modify the watchlist), though it doesn't explicitly name these alternatives.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the stock must already be in the watchlist), contrast with stock_get (which might retrieve any stock regardless of watch status), or specify use cases like checking current watch status versus retrieving general stock data.

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/kinmeic/stock-mcp'

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