Skip to main content
Glama

portfolio_analysis

Analyze stock portfolios to calculate P&L, weights, risk, and identify top performers and underperformers based on holdings data.

Instructions

Analyze a stock portfolio — P&L, weights, risk. [PRO]

Provide your holdings and get total P&L, individual stock performance, portfolio weights, concentration risk, winners and losers.

Args: holdings: JSON string of holdings array. Each holding needs: symbol, quantity, buy_price. Example: '[{"symbol":"RELIANCE","quantity":10,"buy_price":2500}, {"symbol":"TCS","quantity":5,"buy_price":3800}]'

Examples: portfolio_analysis('[{"symbol":"RELIANCE","quantity":10,"buy_price":2500}]') portfolio_analysis('[{"symbol":"AAPL","quantity":5,"buy_price":150}, {"symbol":"MSFT","quantity":3,"buy_price":380}]')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
holdingsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses the [PRO] tier requirement and input format constraints, but omits behavioral details like rate limits, caching behavior, maximum portfolio size, or whether it performs real-time price lookups versus using cached data.

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

Conciseness4/5

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

Well-structured with clear sections (summary, outputs, Args, Examples). Front-loaded with core purpose. Length is justified given need to document complex JSON structure, though the Args section uses verbose formatting that could be tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given presence of output schema, description appropriately focuses on input requirements. With 0% schema coverage, the detailed parameter documentation and examples provide sufficient context for invocation. Minor gap: doesn't mention exchange compatibility (NSE/BSE/US) despite mixed sibling context.

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

Parameters5/5

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

Despite 0% schema description coverage, the description comprehensively documents the 'holdings' parameter: specifies it as a JSON string, details required object fields (symbol, quantity, buy_price), and provides two concrete syntax examples. Fully compensates for schema deficiency.

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?

Description opens with specific verb 'Analyze' + resource 'stock portfolio' and lists concrete outputs (P&L, weights, concentration risk). The [PRO] tag and holdings-based workflow clearly distinguish it from sibling tools like backtest_strategy (strategy testing) and single-stock quote tools.

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?

Description implies usage through 'Provide your holdings and get...' indicating prerequisites (existing holdings with buy prices), but lacks explicit when-to-use guidance versus alternatives like backtest_strategy or guidance on portfolio size limits.

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/finstacklabs/finstack-mcp'

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