API Reference
MCP tools and endpoints available in StockBud
API Reference
StockBud exposes its functionality through MCP (Model Context Protocol) tools. These tools can be called by any MCP-compatible AI assistant like Claude, ChatGPT, or custom integrations.
All tools are available via the MCP stdio transport. Connect using your AI assistant's MCP configuration.
Connection
Portfolio Management
| Tool | Description |
|---|---|
get_portfolio | Get current portfolio with all positions |
get_positions | List all open positions |
get_account | Get account balance and buying power |
analyze_portfolio | AI-powered portfolio analysis |
Market Data
| Tool | Description |
|---|---|
get_quote | Get real-time quote for a symbol |
get_market_data | Get OHLCV bars for a symbol |
get_market_sentiment | Get overall market sentiment |
analyze_stock | Deep analysis of a specific stock |
Trading
Trading tools require a funded Alpaca account. Use paper trading for testing.
| Tool | Description |
|---|---|
place_order | Place a buy/sell order |
cancel_order | Cancel a pending order |
get_orders | List recent orders |
close_position | Close a position |
Research & Analysis
| Tool | Description |
|---|---|
technical_analysis | Get technical indicators |
fundamental_analysis | Get fundamental metrics |
news_analysis | Get news with sentiment |
options_chain | Get options data |
Example Usage
Get Portfolio
Analyze Stock
Tool Schemas
For detailed input/output schemas, see the MCP Server Schema.
Rate Limits
| Category | Limit |
|---|---|
| Market Data | 200 requests/minute |
| Trading | 10 orders/minute |
| Analysis | 50 requests/minute |
Error Handling
All tools return errors in a consistent format:
Common error codes:
| Code | Meaning |
|---|---|
-32600 | Invalid request |
-32601 | Method not found |
-32602 | Invalid params |
-32603 | Internal error |
-32000 | Market closed |
-32001 | Insufficient funds |