Skip to main content
Glama
ww11-max

CSMAR MCP Server

by ww11-max

get_company_info

Retrieve basic company information including financial and stock data by providing a stock code.

Instructions

获取公司基本信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stock_codeYes股票代码

Implementation Reference

  • The handler function that executes the 'get_company_info' tool logic. It ensures login, initializes the Python client, queries the 'company_basic' table for company info by stock code, and returns the result.
        async ({ stock_code }) => {
            try {
                const loginResult = await ensureLogin();
                if (!loginResult.success) {
                    return { content: [{ type: 'text', text: JSON.stringify(loginResult, null, 2) }], isError: true };
                }
                
                const client = await initPythonClient();
                
                // 尝试从公司基本信息表获取
                const result = await client.call('query', {
                    table_name: 'company_basic',
                    columns: ['Stkcd', 'ShortName', 'Industry', 'ListDate', 'Province', 'City'],
                    condition: `Stkcd='${stock_code}'`,
                    limit: 1
                });
                
                if (result.success && result.data && result.data.length > 0) {
                    return { content: [{ type: 'text', text: JSON.stringify(result.data[0], null, 2) }] };
                }
                
                return { content: [{ type: 'text', text: JSON.stringify({ stock_code, message: '未找到公司信息' }, null, 2) }] };
            } catch (error) {
                return { content: [{ type: 'text', text: `获取公司信息错误: ${error.message}` }], isError: true };
            }
        }
    );
  • The input schema definition for 'get_company_info'. It specifies a single required parameter 'stock_code' of type string described as '股票代码' (stock code).
    {
        description: '获取公司基本信息',
        inputSchema: {
            stock_code: z.string().describe('股票代码'),
        },
    },
  • src/index.js:655-690 (registration)
    The registration of the tool 'get_company_info' on the MCP server using server.registerTool(), with its schema and handler.
    // 11. 获取公司信息 (已实现)
    server.registerTool(
        'get_company_info',
        {
            description: '获取公司基本信息',
            inputSchema: {
                stock_code: z.string().describe('股票代码'),
            },
        },
        async ({ stock_code }) => {
            try {
                const loginResult = await ensureLogin();
                if (!loginResult.success) {
                    return { content: [{ type: 'text', text: JSON.stringify(loginResult, null, 2) }], isError: true };
                }
                
                const client = await initPythonClient();
                
                // 尝试从公司基本信息表获取
                const result = await client.call('query', {
                    table_name: 'company_basic',
                    columns: ['Stkcd', 'ShortName', 'Industry', 'ListDate', 'Province', 'City'],
                    condition: `Stkcd='${stock_code}'`,
                    limit: 1
                });
                
                if (result.success && result.data && result.data.length > 0) {
                    return { content: [{ type: 'text', text: JSON.stringify(result.data[0], null, 2) }] };
                }
                
                return { content: [{ type: 'text', text: JSON.stringify({ stock_code, message: '未找到公司信息' }, null, 2) }] };
            } catch (error) {
                return { content: [{ type: 'text', text: `获取公司信息错误: ${error.message}` }], isError: true };
            }
        }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states 'get basic company info', implying a read operation, but gives no details on scope, side effects, or return format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (one sentence), which is front-loaded but lacks substance. It earns its place minimally, but could be more informative without losing conciseness.

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 output schema and sibling tools that may overlap, the description is incomplete. It does not clarify what 'basic company info' includes, leaving ambiguity about its domain.

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?

The input schema covers 100% of parameters with a clear description for 'stock_code'. The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

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 action (获取) and resource (公司基本信息), identifying it as a retrieval tool for basic company info. However, it does not differentiate from sibling tools like get_financial_data or get_stock_data.

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, nor any prerequisites or context for its use.

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/ww11-max/CSMAR-MCP'

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