Skip to main content
Glama
newerton

Status Invest MCP Server

get-acoes

Fetch basic stock information for given symbols. Returns fundamental data for analysis.

Instructions

Buscar informações básicas de ações

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stocksYesArray of stock symbols

Implementation Reference

  • Registration of the 'get-acoes' tool on the MCP server. Defines name, description, input schema (array of stock strings), and the async handler that calls this.service.getStockResume(stocks) and returns the result as JSON.
    private registerGetStockToolHandler(): void {
      this.server.tool(
        'get-acoes',
        'Buscar informações básicas de ações',
        {
          stocks: z.array(z.string()).describe('Array of stock symbols'),
        },
        async (args) => {
          const stocks: string[] = Array.isArray(args.stocks)
            ? args.stocks
            : [args.stocks];
    
          const infos = await this.service.getStockResume(stocks);
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(infos, null, 2),
              },
            ],
          };
        },
      );
    }
  • The getStockResume() method is the actual handler logic for the 'get-acoes' tool. It iterates over stocks, calls apiService.getStockResume() for each, and transforms the response into a structured JSON output with id, type, code, name, price, variation, url, and image.
    async getStockResume(stocks: string[]) {
      const data = [];
      for (const stock of stocks) {
        const stockData = await this.apiService.getStockResume(stock);
        if (stockData && stockData?.length > 0) {
          for (const item of stockData) {
            let type = TypeEnum[item.type];
            if (!type) {
              type = `${item.type} unknown`;
            }
            const jsonData = {
              id: item.id,
              type,
              code: item.code,
              name: item.name,
              price: item.price,
              variation: item.variation,
              variationUp: item.variationUp,
              url: item.url,
              image: `https://statusinvest.com.br/img/company/avatar/${item.parentId}.jpg?v=214`,
            };
            data.push(jsonData);
          }
        }
      }
      return data;
    }
  • The getStockResume() method on the API service fetches stock data from the StatusInvest API at /home/mainsearchquery?q={stock}, returning an array of MainSearchQuery objects.
    async getStockResume(stock: string): Promise<MainSearchQuery[] | null> {
      const data = await this.makeJsonRequest<MainSearchQuery[]>(
        `/home/mainsearchquery?q=${stock.toLowerCase()}`,
      );
      if (!data) return null;
      return data;
    }
  • MainSearchQuery interface defines the shape of data returned by the API for stock resume. Includes id, parentId, nameFormated, name, normalizedName, code, price, variation, variationUp, type (TypeEnum), and url.
    export interface MainSearchQuery {
      id: number;
      parentId: number;
      nameFormated: string;
      name: string;
      normalizedName: string;
      code: string;
      price: string;
      variation: string;
      variationUp: boolean;
      type: TypeEnum;
      url: string;
    }
  • src/main.ts:1-28 (registration)
    Application entry point where the McpServer is created, dependencies are wired together, and StatusInvestToolsController is instantiated with the server, enabling the 'get-acoes' tool registration.
    import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
    import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
    
    import { StatusInvestService } from './application/services/StatusInvestService.js';
    import { StatusInvestApiService } from './infrastructure/services/StatusInvestApiService.js';
    import { StatusInvestToolsController } from './interface/controllers/StatusInvestToolsController.js';
    
    async function main() {
      const server = new McpServer({
        name: 'stocks',
        version: '1.0.0',
      });
    
      const apiService = new StatusInvestApiService();
      const service = new StatusInvestService(apiService);
    
      new StatusInvestToolsController(server, service);
    
      const transport = new StdioServerTransport();
      await server.connect(transport);
      console.error('Status Invest MCP Server running on stdio');
    }
    
    main().catch((error) => {
      console.error('Fatal error in main():', error);
      process.exit(1);
    });
Behavior2/5

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

With no annotations, the description carries the full burden. It does not disclose side effects, required permissions, rate limits, or the nature of returned data. 'Buscar informações básicas' is too vague.

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 a single sentence, which is concise but lacks structure or additional context that could be valuable without being verbose.

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 annotations, the description is insufficient. It does not explain what 'basic information' entails or any constraints, leaving the agent underinformed.

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 coverage is 100% and the parameter description 'Array of stock symbols' is clear. The tool description adds no extra meaning but does not conflict.

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 verb 'Buscar' (get) and resource 'ações' (stocks), indicating it retrieves basic stock information. However, it does not differentiate from siblings or specify what 'basic information' includes.

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 on when to use this tool versus alternatives like 'get-acoes-datas-pagamento' or 'analise-carteira'. The description lacks context for appropriate usage.

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/newerton/mcp-status-invest'

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