Agent Tools & Capabilities
Introduction
The OpsHub Agent System provides 144+ specialized tools that enable AI agents to automate investment operations workflows. These tools transform natural language requests into concrete actions across spreadsheets, databases, dashboards, compliance systems, and more.
Why Tools Matter : Tools are the hands and eyes of AI agents. Without tools, agents can only talk. With tools, they can read data, write reports, validate compliance, create dashboards, and orchestrate complex workflows.
Key Characteristics:
Tenant-Isolated : Every tool call is scoped to the user’s organization and team
Audited : All tool executions are logged to audit.audit_log for compliance
Type-Safe : Pydantic schemas ensure valid parameters
Context-Aware : Tools access workspace context (active portfolio, date, page)
Human-in-the-Loop : Critical operations require user approval via draft system
Priority Tiers
Tools are organized into priority tiers based on usage frequency:
Tier Usage Tool Count Examples P0 Critical 50-80% of conversations 4 tools fetch_and_display, prepare_spreadsheet_workspaceP1 High Priority 30-40% of conversations 7 tools nl_query, create_spreadsheet_chart, emit_agent_insightP2 Feature 10-30% of conversations 15 tools generate_report, validate_compliance, query_resource_detailsSpecialized 5-10% of conversations 107 tools Domain-specific tools for advanced workflows
These tools power the majority of agent interactions. Agents automatically prioritize these in their reasoning.
prepare_spreadsheet_workspace - Set up spreadsheet environment
Purpose : Initialize a Univer Sheets workspace before any spreadsheet operations.When to Use :
User asks to “add data to a spreadsheet”
Before inserting data into sheets
Creating new workbooks
Example :User: "Create a portfolio holdings spreadsheet"
Agent: prepare_spreadsheet_workspace(
purpose = "portfolio holdings analysis" ,
suggestedWorkbookName = "Portfolio Holdings Q4 2025"
)
Returns : UI action to create workbook, navigate to it, and select cell A1.
fetch_and_display - Universal data retrieval and display
Purpose : Fetch data from database and display in appropriate UI (spreadsheet, document, slide, widget).When to Use :
User wants to see database data in any UI component
“Show me portfolios”, “Add holdings to sheet”, “Create dashboard”
Example :User: "Show me active portfolios"
Agent: fetch_and_display(
query = "SELECT * FROM investment.portfolios WHERE portfolio_status = 'Active'" ,
explanation = "Fetching active portfolios for display" ,
uiTarget = "auto" # Auto-detects current UI context
)
Supported UI Targets :
spreadsheet - Univer Sheets (Excel-like grids)
document - Univer Docs (rich text documents)
slide - Univer Slides (presentations)
widget - Dashboard widgets
dashboard - Full dashboard layouts
formula - Formula builder interface
auto - Automatic detection based on workspace context
Returns : Formatted data with appropriate UI action for insertion.
fetch_and_insert_to_spreadsheet - Atomic spreadsheet data insertion
Purpose : Fetch data and insert into spreadsheet in ONE atomic operation.When to Use :
User explicitly wants data in a spreadsheet
Reliability is critical (one-step operation reduces failure points)
Example :User: "Put transaction data in the sheet"
Agent: fetch_and_insert_to_spreadsheet(
query = "SELECT * FROM investment.transactions WHERE transaction_date >= CURRENT_DATE - 30" ,
explanation = "Last 30 days of transactions" ,
includeHeaders = True ,
startRow = 0 ,
startCol = 0
)
Returns : Row count and UI action to insert data at specified location.
insert_data_to_spreadsheet - Insert pre-fetched data
Purpose : Insert already-fetched data array into spreadsheet.When to Use :
You already have data from another tool call
Inserting transformed or filtered data
Example :# Step 1: Get data from database tool
result = execute_database_query( ... )
# Step 2: Insert the data
Agent: insert_data_to_spreadsheet(
data = result.data, # MUST pass the data array
startRow = 0 ,
includeHeaders = True
)
Common Mistake : Forgetting to pass the data parameter. Always pass the data array from previous query results.
Returns : UI action with row/column count for insertion.
Data Access & Querying
nl_query - Natural language to SQL (PRIMARY data access)
Purpose : Convert plain English questions to validated SQL queries and return formatted results.This is the PRIMARY tool for accessing database information. Use this for all user questions about data.Capabilities :
Converts natural language to SQL using GPT-4 with full schema context
Validates SQL for safety (blocks DROP, DELETE, etc.)
Executes query with row limits
Formats results in natural language
Stores query history for learning
Context-Aware Features :
Auto-filters by selected portfolio/date if available
Focuses on relevant tables from current page context
Uses active dashboard/workflow state to scope queries
Example :User: "Which portfolios have the highest VaR this month?"
Agent: nl_query(
question = "Which portfolios have the highest VaR this month?" ,
include_sql = True ,
max_results = 100
)
# Returns:
{
"success" : True ,
"summary" : "Found 12 portfolios with VaR data. Top 3: ABC Fund (VaR: $2.3M), XYZ Fund (VaR: $1.8M)..." ,
"data" : [ ... ],
"sql_query" : "SELECT portfolio_name, var_95 FROM risk.portfolio_risk_metrics..." ,
"generation" : {
"confidence" : 0.95 ,
"explanation" : "Queried risk.portfolio_risk_metrics for VaR calculations" ,
"tables_used" : [ "risk.portfolio_risk_metrics" , "investment.portfolios" ]
}
}
Best Practices :
Use for ALL data retrieval questions
Let the tool handle SQL generation (don’t write SQL manually)
Check confidence score - warn user if < 0.7
Review warnings array for potential issues
get_query_history - Learn from past queries
Purpose : Retrieve recent successful queries to improve future query generation.When to Use :
Understanding common query patterns
Finding examples for similar questions
Debugging failed queries
Example :result = get_query_history( limit = 20 , user_id = "user-123" )
# Returns:
{
"success" : True ,
"total_queries" : 20 ,
"successful_count" : 18 ,
"failed_count" : 2 ,
"common_patterns" : [
{
"pattern" : "Aggregation" ,
"count" : 8 ,
"examples" : [ ... ]
}
],
"suggestions" : [
"Try: 'Show me all active portfolios ordered by AUM'" ,
"Try: 'What validation rules failed today?'"
]
}
Visualization & Analysis
create_spreadsheet_chart - Visualize data in sheets
Purpose : Create charts and visualizations within Univer Sheets.Chart Types :
line - Time series, trends
bar - Comparisons, rankings
pie - Composition, percentages
scatter - Correlations, distributions
area - Cumulative values
Example :User: "Show portfolio AUM over time as a line chart"
Agent: create_spreadsheet_chart(
chartType = "line" ,
dataRange = "A1:B13" ,
title = "Portfolio AUM Trend" ,
xAxisLabel = "Date" ,
yAxisLabel = "AUM ($M)"
)
create_pivot_table - Aggregate and summarize
Purpose : Create pivot tables for data aggregation and analysis.Example :Agent: create_pivot_table(
dataRange = "A1:E100" ,
rowFields = [ "portfolio_name" ],
columnFields = [ "asset_class" ],
valueField = "market_value" ,
aggregation = "sum"
)
spreadsheet_analyze - AI-powered data analysis
Purpose : Use AI to analyze data patterns, outliers, and insights in spreadsheets.Example :Agent: spreadsheet_analyze(
dataRange = "A1:F100" ,
analysisType = "outlier_detection" ,
context = "Looking for unusual holdings concentrations"
)
Communication & Insights
emit_agent_insight - Proactive recommendations
Purpose : Send proactive insights and recommendations to the user.Insight Categories :
info - Informational messages
warning - Potential issues requiring attention
risk - Risk alerts and compliance concerns
dependency - Workflow dependencies and blockers
Example :Agent: emit_agent_insight(
message = "Portfolio ABC has 3 validation breaches requiring immediate review" ,
category = "warning" ,
references = [ "validation-breach-001" , "validation-breach-002" ]
)
When to Use :
Discovered issues during analysis
Proactive risk identification
Workflow status updates
Dependency alerts
record_agent_draft - Propose changes for approval
Purpose : Record proposed changes for user review before execution (Human-in-the-Loop).Example :Agent: record_agent_draft(
agentId = "fund-accountant" ,
title = "Auto-reconcile 5 NAV breaks" ,
summary = "Identified root causes for 5 NAV variances. Propose automatic resolution." ,
payload = {
"reconciliations" : [ ... ]
},
metadata = {
"rationale" : "All breaks are due to timing differences in custodian feeds" ,
"risks" : [ "Automatic adjustment may mask underlying data quality issues" ],
"nextActions" : [ "Validate custodian feed timing" , "Update reconciliation rules" ]
}
)
Always use drafts for :
Data modifications
Compliance approvals
Workflow changes
High-risk operations
apply_agent_draft - Execute approved changes
Purpose : Apply a draft that has been approved by the user.Example :# After user approves draft
Agent: apply_agent_draft(
draftId = "draft-12345" ,
userId = "user-789"
)
These tools provide Excel-equivalent functionality for Univer Sheets, the platform’s spreadsheet engine.
Spreadsheet Manipulation Tools
Database Query & Schema Tools
Already covered in P1 High Priority Tools:
nl_query - Convert natural language to SQL
get_query_history - Learn from past queries
Predictive Analytics & Alerts
predict_breach ML-powered prediction of future compliance breaches. predict_breach(
portfolioId = "portfolio-123" ,
rule = "NAV_VARIANCE_3BP" ,
lookAheadDays = 7
)
# Returns:
{
"breach_probability" : 0.78 ,
"confidence" : 0.85 ,
"risk_factors" : [ "Historical volatility" , "Market conditions" ],
"recommended_actions" : [ "Increase monitoring frequency" , "Review tolerance settings" ]
}
get_breach_risk_score Calculate aggregate risk score for all portfolios. get_breach_risk_score( portfolioIds = [ "p1" , "p2" , "p3" ])
detect_anomaly Real-time outlier detection in holdings and transactions. detect_anomaly(
dataType = "holdings" ,
portfolioId = "portfolio-123" ,
sensitivity = 0.8 # 0.0-1.0
)
# Returns outliers with explanations
get_anomaly_alerts Retrieve active anomaly alerts for monitoring. get_anomaly_alerts(
portfolioId = "portfolio-123" ,
status = "active"
)
auto_reconcile Automatically analyze and resolve NAV breaks. auto_reconcile(
portfolioId = "portfolio-123" ,
date = "2025-10-29" ,
toleranceBps = 3 # 3 basis points
)
# Returns:
{
"total_breaks" : 5 ,
"auto_resolved" : 3 ,
"manual_review_required" : 2 ,
"resolutions" : [
{
"break_id" : "break-001" ,
"root_cause" : "Timing difference in custodian feed" ,
"proposed_adjustment" : 150.25 ,
"confidence" : 0.92
}
]
}
get_reconciliation_history Retrieve reconciliation audit trail. get_reconciliation_history(
portfolioId = "portfolio-123" ,
dateRange = { "start" : "2025-10-01" , "end" : "2025-10-29" }
)
ASIC RG94 Compliance Tools
generate_report Generate regulatory and operational reports. Report Types :
nav_certification - Daily NAV certification
breach_summary - Validation breach report
reconciliation_status - Reconciliation summary
performance_attribution - Performance analysis
compliance_summary - Compliance status
generate_report(
report_type = "nav_certification" ,
portfolioId = "portfolio-123" ,
date = "2025-10-29" ,
format = "pdf"
)
list_report_templates Browse available report templates. list_report_templates( category = "compliance" )
schedule_report Schedule recurring report generation. schedule_report(
report_type = "breach_summary" ,
frequency = "daily" ,
time = "08:00" ,
recipients = [ "[email protected] " ]
)
Temporal Workflow Automation
generate_workflow Generate Temporal workflow definitions from natural language. generate_workflow(
description = "Daily NAV validation with automatic reconciliation and email notifications" ,
trigger = "cron" ,
triggerConfig = { "schedule" : "0 8 * * *" } # 8 AM daily
)
# Returns Temporal workflow YAML definition
validate_workflow Validate workflow definition before deployment. validate_workflow(
workflow_definition = { ... }
)
optimize_workflow Suggest workflow optimizations. optimize_workflow(
workflow_id = "workflow-789"
)
# Returns:
{
"suggestions" : [
"Parallelize custodian data fetches (20 % f aster)" ,
"Cache validation rules (reduce DB queries by 50%)"
]
}
Task Scheduling & Optimization
optimize_schedule Optimize task scheduling to minimize bottlenecks. optimize_schedule(
tasks = [
{ "id" : "fetch_prices" , "duration" : 300 , "dependencies" : []},
{ "id" : "calc_nav" , "duration" : 120 , "dependencies" : [ "fetch_prices" ]},
{ "id" : "validate" , "duration" : 60 , "dependencies" : [ "calc_nav" ]}
]
)
# Returns optimized schedule with start times
analyze_schedule_patterns Analyze historical scheduling patterns for bottlenecks. analyze_schedule_patterns(
workflow_id = "daily-nav-workflow" ,
period_days = 30
)
get_scheduling_statistics Retrieve scheduling performance metrics. get_scheduling_statistics( workflow_id = "daily-nav-workflow" )
Context-Aware Automation Suggestions
generate_suggestions Generate context-aware automation suggestions. generate_suggestions(
context = "User reviewing NAV breaks" ,
limit = 3
)
# Returns:
[
{
"title" : "Auto-reconcile timing differences" ,
"action" : "auto_reconcile" ,
"confidence" : 0.87 ,
"reason" : "3 breaks have same root cause pattern"
}
]
apply_suggestion Apply a suggestion with one click. apply_suggestion( suggestion_id = "sugg-123" )
undo_suggestion Rollback a previously applied suggestion. undo_suggestion( suggestion_id = "sugg-123" )
provide_suggestion_feedback Improve suggestions through feedback. provide_suggestion_feedback(
suggestion_id = "sugg-123" ,
helpful = True ,
comment = "Saved 30 minutes of manual work"
)
get_suggestion_stats Retrieve suggestion performance metrics. get_suggestion_stats( userId = "user-123" )
Multi-Agent Collaboration
delegate_to_agent Delegate task to a specialized agent. delegate_to_agent(
target_agent = "compliance-sentinel" ,
task = "Validate all portfolios against ASIC RG94 requirements" ,
context = {
"portfolios" : [ "p1" , "p2" , "p3" ],
"date" : "2025-10-29"
}
)
execute_parallel_tasks Execute tasks across multiple agents in parallel. execute_parallel_tasks(
tasks = [
{ "agent" : "data-quality-analyst" , "task" : "Profile data quality" },
{ "agent" : "compliance-sentinel" , "task" : "Check compliance" },
{ "agent" : "risk-analyst" , "task" : "Calculate VaR" }
]
)
get_delegation_history Retrieve agent delegation audit trail. get_delegation_history( sessionId = "session-123" )
Memory & Context (4 Tools)
remember_fact Store facts for future recall. remember_fact(
fact = "User prefers NAV reports in PDF format" ,
category = "user_preference" ,
importance = 0.8
)
recall_cases Retrieve similar past cases for context. recall_cases(
query = "NAV break due to FX rate mismatch" ,
limit = 5
)
learn_from_feedback Update knowledge base from user corrections. learn_from_feedback(
original_action = "auto_reconcile" ,
feedback = "Should have flagged for manual review" ,
outcome = "negative"
)
get_memory_statistics Retrieve memory system statistics. get_memory_statistics( userId = "user-123" )
Intelligent Document Processing
Extract structured data from PDFs and text documents. extract_from_document(
document_url = "https://storage/custodian-report.pdf" ,
extraction_type = "holdings" ,
schema = {
"fields" : [ "security_name" , "quantity" , "market_value" , "currency" ]
}
)
# Returns structured data array
Retrieve document extraction history. get_extraction_history( limit = 20 )
explain_decision Explain why the agent made a specific decision. explain_decision(
decision_id = "decision-456" ,
detail_level = "detailed" # "summary" | "detailed" | "technical"
)
# Returns:
{
"reasoning" : "Identified 5 NAV breaks with same root cause pattern..." ,
"evidence" : [
"Break-001: Timing difference of +2 hours" ,
"Break-002: Timing difference of +2.5 hours"
],
"confidence" : 0.92 ,
"alternative_actions" : [
"Manual review of all breaks" ,
"Adjust custodian feed timing"
]
}
provide_feedback Provide feedback on agent actions. provide_feedback(
action_id = "action-789" ,
rating = 5 , # 1-5
comment = "Accurate and saved significant time"
)
get_explainability_stats Retrieve explanation statistics. get_explainability_stats( agentId = "fund-accountant" )
auto_heal_workflow Automatically recover from workflow errors. auto_heal_workflow(
workflow_id = "daily-nav-workflow" ,
error_type = "connection_timeout"
)
# Returns healing actions taken (retry, fallback, skip, etc.)
get_healing_history Retrieve self-healing audit trail. get_healing_history(
workflow_id = "daily-nav-workflow" ,
period_days = 7
)
Cross-Agent Performance Analytics
Dashboard Builder Automation
create_dashboard Create new dashboard from template or scratch. create_dashboard(
name = "Portfolio Risk Dashboard" ,
template_id = "risk-overview" ,
description = "Real-time portfolio risk monitoring"
)
Add widget to dashboard. add_widget(
dashboard_id = "dash-123" ,
widget_type = "chart" ,
title = "VaR by Portfolio" ,
config = {
"chartType" : "bar" ,
"dataSource" : "risk.portfolio_risk_metrics" ,
"xField" : "portfolio_name" ,
"yField" : "var_95"
}
)
Update existing widget configuration. configure_widget(
dashboard_id = "dash-123" ,
widget_id = "widget-456" ,
config = { "colors" : [ "#FF6B6B" , "#4ECDC4" ]}
)
Remove widget from dashboard. remove_widget( dashboard_id = "dash-123" , widget_id = "widget-456" )
apply_dashboard_filter Apply global filters to dashboard. apply_dashboard_filter(
dashboard_id = "dash-123" ,
filters = [
{ "field" : "portfolio_id" , "operator" : "in" , "value" : [ "p1" , "p2" ]},
{ "field" : "date" , "operator" : ">=" , "value" : "2025-10-01" }
]
)
export_dashboard Export dashboard to PDF, PNG, JSON, or Excel. export_dashboard(
dashboard_id = "dash-123" ,
format = "pdf" ,
options = { "pageSize" : "A4" , "quality" : "high" }
)
submit_dashboard_for_approval Submit dashboard for compliance approval. submit_dashboard_for_approval(
dashboard_id = "dash-123" ,
approvers = [ "user-789" ],
comment = "New risk dashboard for board review"
)
get_dashboard_details Retrieve dashboard configuration and widgets. get_dashboard_details(
dashboard_id = "dash-123" ,
include_widgets = True
)
Visual Query Builder Automation
add_table_to_canvas Add table to visual query builder canvas. add_table_to_canvas(
schema = "investment" ,
table = "portfolios" ,
position = { "x" : 100 , "y" : 100 }
)
create_join Create join between tables. create_join(
leftTable = "investment.portfolios" ,
rightTable = "investment.holdings" ,
joinType = "inner" ,
condition = "portfolios.portfolio_id = holdings.portfolio_id"
)
add_filter Add filter to query. add_filter(
field = "portfolio_status" ,
operator = "equals" ,
value = "Active"
)
add_calculation Add calculated field. add_calculation(
name = "total_value" ,
formula = "quantity * price" ,
dataType = "decimal"
)
select_columns Choose columns to include in query. select_columns(
columns = [
"portfolios.portfolio_name" ,
"holdings.security_name" ,
"holdings.market_value"
]
)
generate_sql Generate SQL from visual query. generate_sql()
# Returns optimized SQL with proper joins and filters
preview_query_results Preview query results before execution. preview_query_results( limit = 10 )
save_query Save query for reuse. save_query(
name = "Active Portfolio Holdings" ,
description = "Holdings for all active portfolios" ,
category = "portfolio_analysis"
)
export_query_results Export query results to various formats. export_query_results(
format = "excel" ,
filename = "holdings_export.xlsx"
)
Complete Frontend Automation
navigate_to_page Navigate to specific page/view. navigate_to_page(
page = "/data-modeling" ,
params = { "workbookId" : "wb-123" }
)
open_modal Open modal dialog. open_modal(
modalType = "create_portfolio" ,
props = { "defaultValues" : { ... }}
)
close_modal Close active modal. Trigger button click. click_button( buttonId = "save-portfolio-btn" )
Populate form field. fill_form_field(
fieldId = "portfolio_name" ,
value = "Global Equity Fund"
)
Submit form. submit_form( formId = "create-portfolio-form" )
select_tab Switch to specific tab. select_tab( tabId = "holdings-tab" )
Show/hide sidebar. toggle_sidebar( visible = False )
show_notification Display toast notification. show_notification(
message = "Portfolio created successfully" ,
type = "success" ,
duration = 3000
)
Scroll to specific element. scroll_to_element( elementId = "validation-breach-section" )
highlight_element Highlight element for user attention. highlight_element(
elementId = "nav-variance-cell" ,
duration = 2000
)
Open context menu. open_context_menu(
targetId = "portfolio-row-5" ,
position = { "x" : 300 , "y" : 200 }
)
trigger_keyboard_shortcut Simulate keyboard shortcut. trigger_keyboard_shortcut(
shortcut = "ctrl+s" # Save
)
update_url_params Update URL parameters without navigation. update_url_params(
params = { "portfolioId" : "p-123" , "date" : "2025-10-29" }
)
create_pipeline Create new data pipeline. create_pipeline(
name = "Custodian Daily Feed" ,
source = "sftp://custodian.com/daily" ,
destination = "investment.holdings"
)
Configure data source. configure_source(
pipeline_id = "pipe-123" ,
source_type = "sftp" ,
config = {
"host" : "custodian.com" ,
"username" : "user" ,
"path" : "/daily/*.csv"
}
)
map_fields Map source fields to destination schema. map_fields(
pipeline_id = "pipe-123" ,
mappings = [
{ "source" : "ISIN" , "destination" : "security_isin" },
{ "source" : "QTY" , "destination" : "quantity" }
]
)
Add data transformation rule. add_transformation(
pipeline_id = "pipe-123" ,
transformation_type = "ai_normalize" ,
config = {
"field" : "security_name" ,
"rules" : [ "Remove extra whitespace" , "Standardize case" ]
}
)
add_validation_rule Add data quality validation. add_validation_rule(
pipeline_id = "pipe-123" ,
rule_type = "not_null" ,
field = "security_isin"
)
add_data_quality_check Add data quality check. add_data_quality_check(
pipeline_id = "pipe-123" ,
check_type = "duplicate_detection" ,
field = "security_isin"
)
Schedule pipeline execution. configure_schedule(
pipeline_id = "pipe-123" ,
schedule = "0 8 * * *" , # Daily at 8 AM
timezone = "America/New_York"
)
run_pipeline Execute pipeline immediately. run_pipeline( pipeline_id = "pipe-123" )
get_pipeline_status Check pipeline execution status. get_pipeline_status( pipeline_id = "pipe-123" )
get_pipeline_logs Retrieve pipeline execution logs. get_pipeline_logs(
pipeline_id = "pipe-123" ,
limit = 50
)
view_data_lineage View data lineage graph. view_data_lineage(
table = "investment.holdings" ,
upstream = True ,
downstream = True
)
export_pipeline_config Export pipeline configuration. export_pipeline_config(
pipeline_id = "pipe-123" ,
format = "json"
)
clone_pipeline Duplicate existing pipeline. clone_pipeline(
source_pipeline_id = "pipe-123" ,
new_name = "Custodian Daily Feed - Backup"
)
Private Equity Valuation Suite
calculate_dcf_valuation Perform Discounted Cash Flow valuation. calculate_dcf_valuation(
revenue = [ 100 , 110 , 121 , 133 , 146 ], # 5-year projections
revenue_growth_rate = 10.0 ,
ebitda_margin = 25.0 ,
tax_rate = 21.0 ,
capex_as_percent_of_revenue = 5.0 ,
nwc_as_percent_of_revenue = 10.0 ,
wacc = 10.0 ,
terminal_growth_rate = 3.0 ,
net_debt = 50.0
)
# Returns:
{
"enterprise_value" : 825.5 ,
"equity_value" : 775.5 ,
"implied_ev_ebitda_multiple" : 11.2 ,
"free_cash_flows" : [ 18.5 , 20.4 , 22.4 , 24.6 , 27.1 ],
"terminal_value" : 387.1 ,
"present_value_fcf" : 438.4 ,
"present_value_terminal" : 387.1
}
calculate_comparable_companies Calculate valuation based on comparable companies. calculate_comparable_companies(
target_revenue = 100.0 ,
target_ebitda = 25.0 ,
comparables = [
{ "company" : "Comp A" , "ev_revenue" : 2.5 , "ev_ebitda" : 12.0 },
{ "company" : "Comp B" , "ev_revenue" : 3.0 , "ev_ebitda" : 14.0 }
]
)
validate_valuation_assumptions Validate reasonableness of valuation assumptions. validate_valuation_assumptions(
assumptions = {
"revenue_growth_rate" : 50.0 , # High growth
"ebitda_margin" : 60.0 , # Very high margin
"wacc" : 5.0 # Low discount rate
},
industry = "software"
)
# Returns validation warnings and benchmarks
generate_investment_memo Generate investment memo document. generate_investment_memo(
company_name = "Tech Startup Inc" ,
valuation_results = { ... },
investment_thesis = "Leading position in AI infrastructure" ,
risks = [ "Regulatory changes" , "Competition" ],
template = "standard"
)
generate_investment_recommendation Generate investment recommendation based on analysis. generate_investment_recommendation(
valuation_results = { ... },
target_return = 25.0 ,
risk_tolerance = "moderate"
)
# Returns: "buy", "hold", or "pass" with rationale
Spectacle Chart & Dashboard Creation
create_spectacle_chart Create chart using Spectacle library. create_spectacle_chart(
chartType = "line" ,
data = [ ... ],
title = "Portfolio Performance" ,
xAxis = "date" ,
yAxis = "value"
)
create_spectacle_dashboard Create dashboard with Spectacle. create_spectacle_dashboard(
name = "Executive Dashboard" ,
layout = "grid" ,
widgets = [ ... ]
)
Add widget to Spectacle dashboard. add_spectacle_widget(
dashboard_id = "dash-123" ,
widget_type = "metric" ,
config = { ... }
)
create_spectacle_slide Create presentation slide with Spectacle. create_spectacle_slide(
presentation_id = "pres-123" ,
layout = "title_and_content" ,
content = { ... }
)
export_spectacle_visualization Export Spectacle visualization. export_spectacle_visualization(
viz_id = "viz-123" ,
format = "png" ,
options = { "resolution" : "high" }
)
Rich Text Document Creation
create_lexical_document Create new Lexical document. create_lexical_document(
title = "Investment Memo - Tech Startup Inc" ,
template = "investment_memo"
)
insert_text Insert text at cursor position. insert_text(
document_id = "doc-123" ,
text = "This is the executive summary..." ,
position = "end"
)
insert_table Insert table into document. insert_table(
document_id = "doc-123" ,
rows = 5 ,
columns = 3 ,
headers = [ "Metric" , "2024" , "2025" ]
)
insert_heading Insert heading. insert_heading(
document_id = "doc-123" ,
text = "Financial Projections" ,
level = 2 # H2
)
insert_list Insert bulleted or numbered list. insert_list(
document_id = "doc-123" ,
items = [ "Risk 1" , "Risk 2" , "Risk 3" ],
list_type = "bullet"
)
format_text Apply formatting to selected text. format_text(
document_id = "doc-123" ,
selection = { "start" : 0 , "end" : 20 },
formatting = { "bold" : True , "fontSize" : 18 }
)
Multiple Solution Generation
generate_options Generate multiple solution options for user choice. generate_options(
problem = "How to resolve 5 NAV breaks?" ,
num_options = 3
)
# Returns 3 different approaches with pros/cons
refine_option Refine a specific option based on user feedback. refine_option(
option_id = "opt-123" ,
feedback = "Focus more on automation"
)
compare_options Compare multiple options side-by-side. compare_options(
option_ids = [ "opt-123" , "opt-456" ],
criteria = [ "time" , "accuracy" , "automation_level" ]
)
User Asks a Question Primary Tool : nl_queryConvert natural language to SQL and return formatted results. Example: “Which portfolios are underperforming?”
User Wants Data in Spreadsheet Primary Tool : fetch_and_display or fetch_and_insert_to_spreadsheetAtomic operation to fetch and insert data. Example: “Add holdings to the sheet”
User Requests a Report Primary Tool : generate_reportGenerate formatted reports with templates. Example: “Generate NAV certification report”
User Wants to Create a Dashboard Primary Tool : create_dashboard + add_widgetBuild custom dashboards programmatically. Example: “Create a risk monitoring dashboard”
User Needs Compliance Check Primary Tool : check_complianceValidate against regulatory requirements. Example: “Is this NAV variance compliant?”
User Asks for Automation Primary Tool : generate_workflow + generate_suggestionsCreate workflows and suggest automations. Example: “Automate daily NAV validation”
Decision Tree
Tenant Isolation
Every tool execution is wrapped with tenant context injection :
@with_tenant_context
async def tool_function ( * args , ** kwargs ):
# Tenant ID automatically injected
# All queries scoped to user's organization
tenant_id = kwargs[ "tenant_id" ]
...
Benefits :
Data Isolation : Users only see their organization’s data
Audit Trail : Every tool call logged with tenant context
Quota Enforcement : Rate limits per tenant
Permission Checks : IAM-based access control
Row-Level Security (RLS)
Database queries automatically filtered by RLS policies:
-- Example: Users can only access portfolios in their team
CREATE POLICY "Users access team portfolios"
ON investment . portfolios
FOR SELECT
USING (
portfolio_id IN (
SELECT portfolio_id
FROM iam . team_members
WHERE user_id = auth . uid ()
)
);
Protected Schemas :
✅ iam.* - Identity and access management
✅ vault.* - Credential storage (admin-only)
✅ agent.* - Agent sessions and drafts
✅ investment.* - Portfolio and holdings data
✅ validation.* - Compliance validation data
✅ audit.* - Audit logs (compliance/admin only)
Permission Model
IAM Roles :
ADMIN - Full system access (GLOBAL scope)
FUND_MANAGER - Manage funds and strategies (ORGANIZATION scope)
PORTFOLIO_MANAGER - Manage portfolios (TEAM scope)
OPERATIONS_LEAD - Operational activities (ORGANIZATION scope)
COMPLIANCE_OFFICER - Compliance and audits (ORGANIZATION scope)
VIEWER - Read-only access (TEAM scope)
Tool Permissions by Role :
Tool Category Viewer Portfolio Manager Operations Lead Compliance Officer Admin Data Query ✅ Read ✅ Read ✅ Read ✅ Read ✅ Full Spreadsheet ✅ Read ✅ Full ✅ Full ✅ Read ✅ Full Reports ✅ Read ✅ Generate ✅ Generate ✅ Full ✅ Full Compliance ❌ ❌ ✅ Check ✅ Full ✅ Full Workflows ❌ ❌ ✅ Full ✅ Read ✅ Full Approvals ❌ ✅ Request ✅ Approve ✅ Approve ✅ Full Admin Tools ❌ ❌ ❌ ❌ ✅ Full
Destructive Operations Require Approval :
Data modifications (UPDATE, DELETE)
Compliance approvals
Workflow changes
Always use the draft system for high-risk operations
Standard Execution
Human-in-the-Loop Execution
Error Handling
Latency Benchmarks
Tool Category P50 Latency P95 Latency Notes nl_query 2.5s 5.0s Includes GPT-4 reasoning + SQL execution Database Query 150ms 500ms Direct SQL, no AI Spreadsheet 50ms 200ms Client-side execution Dashboard 300ms 1.0s Multiple widget queries Report Generation 5.0s 15.0s Includes PDF rendering Workflow Generation 3.0s 8.0s AI workflow definition generation Compliance Check 200ms 600ms Rule evaluation
Optimization Tips
For Faster Data Access :
Use nl_query for complex questions (caches schema)
Use execute_database_query for repeated queries (skip AI reasoning)
Specify max_results to limit data transfer
Use workspace context filters to scope queries
For Reliable Operations :
Use P0 tools (fetch_and_display, prepare_spreadsheet_workspace) for common tasks
Always use drafts for high-risk operations
Check tool return status before proceeding
Provide clear error messages to users
Developers can extend the agent system with custom tools. See Advanced: Custom Tool Development for details.
from langchain_core.tools import tool
from pydantic import BaseModel, Field
from typing import Optional
class MyToolInput ( BaseModel ):
"""Input schema for my custom tool"""
param1: str = Field( description = "Parameter description" )
param2: int = Field( default = 10 , description = "Optional parameter" )
@tool ( "my_custom_tool" , args_schema = MyToolInput)
def my_custom_tool (
param1 : str ,
param2 : int = 10 ,
config : Optional[RunnableConfig] = None
) -> dict :
"""
Brief description of what this tool does.
Detailed description with use cases and examples.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Result dictionary with success status and data
"""
try :
# Tool implementation
result = do_something(param1, param2)
return {
"success" : True ,
"data" : result
}
except Exception as e:
return {
"success" : False ,
"error" : str (e)
}
# In app/agent/tools/__init__.py
from app.agent.tools.my_custom_tools import get_my_tools
def get_all_tools ( agent_id : Optional[ str ] = None ):
tools = [
# ... existing tools
]
# Add custom tools
tools.extend(get_my_tools())
return tools
Summary
Total Tools : 133 tools
P0 Critical : 4 tools (50-80% usage)
P1 High Priority : 7 tools (30-40% usage)
P2 Feature : 15 tools (10-30% usage)
Specialized : 107 tools (5-10% usage)
Coverage Areas
Data Access
Natural language query
Direct SQL execution
Schema inspection
Resource details
Automation
Spreadsheet manipulation
Dashboard creation
Workflow generation
Report automation
Intelligence
Breach prediction
Anomaly detection
Auto-reconciliation
Smart suggestions
Governance
Compliance checks
Approval workflows
Audit trails
ASIC RG94 validation
Collaboration
Agent delegation
Multi-agent coordination
Draft system
User feedback
Insights
Explainable AI
Memory & learning
Performance analytics
ROI calculation
Next Steps
Have Questions?
API Documentation : See /docs/api/agent-api.yaml for OpenAPI specs
Developer Guide : See opshub-agent-backend/README.md
Support : Contact [email protected]