Skip to main content
Glama

portfolio_analysis

Analyze stock portfolio performance including P&L, weights, and risk by providing holdings as JSON.

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 are provided, so the description must disclose behavioral traits. It mentions the tool provides analysis results (P&L, weights, risk) but does not explicitly state if it is read-only or if there are side effects. The presence of an output schema helps, but further details on data sources or limitations would improve transparency.

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?

The description is well-structured with a brief intro, parameter documentation, and examples. It is front-loaded with the purpose. While slightly lengthy, it avoids unnecessary information and is easy to parse.

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 the tool has one parameter and an output schema, the description covers the core functionality and usage. Minor gaps exist, such as error handling or limits on holdings size, but overall it is sufficient for correct use.

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?

The input schema has only one parameter with zero description coverage, but the tool description includes a detailed explanation of the 'holdings' parameter, including format, required fields, and an example. This fully compensates for the schema's lack of param documentation.

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 it analyzes a stock portfolio, covering P&L, weights, risk, winners, and losers. It uses specific verbs and resources, and the PRO tag distinguishes it from free tools. Among siblings, there is an 'analyze_portfolio' tool, but this description provides enough detail to differentiate.

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 explains how to use the tool with examples and parameter requirements. However, it does not explicitly state when to use this tool versus alternatives like 'analyze_portfolio' or 'backtest_strategy', leaving some ambiguity.

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