Overview
The database tools suite provides agents with structured access to OpsHub data across multiple schemas:- validation: Validation rules, runs, and breach data
- investment: Portfolio, holdings, and NAV information
- analytics: Dashboards and reporting
- workflow: Temporal workflow definitions and execution history
- integration: ETL pipeline configurations
Quick Reference
| Tool | Purpose | Key Parameters |
|---|---|---|
query_database | Execute SELECT queries | query, schema, limit |
inspect_schema | Discover tables and columns | schema_name, include_columns |
get_validation_summary | Validation status snapshot | None (context-aware) |
get_portfolio_summary | Portfolio overview data | portfolio_id (optional) |
query_resource_details | Dashboard/workflow/pipeline metadata | type, id |
Tools Reference
query_database
Type: Tool Parameters: DatabaseQueryInput Returns: Dict with success, data, row_count, schema, context_aware Execute read-only SQL queries against the OpsHub database with automatic schema context detection. Parameters:query(string, required): SQL SELECT query to execute. Only SELECT statements are allowed.schema(string, optional): Database schema to scope the query (e.g., ‘validation’, ‘investment’, ‘analytics’, ‘workflow’, ‘integration’). If not provided, automatically detects from workspace focus mode.limit(integer, optional): Maximum rows to return. Default: 100, Maximum: 1000. Automatically appended to query if not present.
success(boolean): Query execution statusdata(array): List of row objectsrow_count(integer): Number of rows returnedschema(string): Schema that was queriedcontext_aware(object): Context detection info including focus_mode and schema_auto_detected flagerror(string, optional): Error message if query failed
- Beta SQL injection protection via query validator
- Only SELECT queries allowed; DROP, DELETE, TRUNCATE, and other dangerous keywords blocked
- Multiple statements blocked
- SQL comments blocked
- Queries automatically scoped by workspace context
- Row-level security enforced at database layer
- Dangerous keywords: DROP, DELETE, TRUNCATE, ALTER, EXEC, etc.
inspect_schema
Type: Tool Parameters: SchemaInspectionInput Returns: Dict with success, schema, tables, table_count Discover available tables and column structure within a database schema before querying. Parameters:schema_name(string, required): Schema to inspect (e.g., ‘validation’, ‘investment’, ‘analytics’, ‘workflow’, ‘integration’)include_columns(boolean, optional): If true, include detailed column information (names, types, constraints) for each table. Default: false
success(boolean): Inspection statusschema(string): Schema name inspectedtables(array): List of table objects with metadatatable_count(integer): Number of tables in schemaerror(string, optional): Error message if inspection failed
get_validation_summary
Type: Tool Parameters: None (context-aware) Returns: Dict with success, summary, active_rules, breached_rules, unresolved_breaches Get a quick snapshot of validation status and outstanding breaches without writing custom queries. Parameters: None Returns:success(boolean): Execution statussummary(object): Validation summary with metricsactive_rules(integer): Number of active validation rulesbreached_rules(integer): Number of rules with active breachesunresolved_breaches(integer): Count of unresolved breacheserror(string, optional): Error message if call failed
get_portfolio_summary
Type: Tool Parameters: portfolio_id (optional string) Returns: Dict with success, portfolio/portfolios, count Retrieve portfolio overview data including NAV, status, and holdings information. Parameters:portfolio_id(string, optional): ID of specific portfolio to query. If omitted, returns summary of all portfolios (limited to 50).
success(boolean): Execution statusportfolio(object): Portfolio object with nested holdings counterror(string, optional): Error message if call failed
success(boolean): Execution statusportfolios(array): List of portfolio objects (id, name, portfolio_code, total_nav, status)count(integer): Number of portfolios returnederror(string, optional): Error message if call failed
query_resource_details
Type: Tool (Async) Parameters: type (string), id (string) Returns: Dict with success, type, data, message Retrieve detailed configuration and metadata for dashboards, workflows, and integration pipelines. Parameters:type(string, required): Resource type - must be one of: “dashboard”, “workflow”, or “pipeline”id(string, required): ID of the resource to retrieve
success(boolean): Query statustype(string): Resource type querieddata(object, optional): Resource details object (structure varies by type)message(string): Human-readable status messageerror(string, optional): Error details if query failed
- Fields: id, name, description, category, status, visibility, layout, widgets, filters, data_sources, tags, created_at, updated_at
- Fields: id, name, description, definition, status, schedule, version, created_by, updated_by, created_at, updated_at, last_run_at
- Fields: id, name, description, status, source_config, destination_table, destination_schema, schedule_type, schedule_config, tags, created_by, created_at, updated_at
Security Considerations
Read-Only Access
- Only SELECT queries are allowed
- INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE, and EXEC statements are blocked
- Multiple statements in a single query are rejected
Query Validation (Beta)
The query validator performs pattern matching against dangerous keywords and SQL injection vectors:- SQL comments (— and /**/) are stripped
- Semicolon-separated statements are blocked
- Keywords are checked in uppercase and mixed-case variants
Row-Level Security
All queries respect database-level row-level security policies. Users can only access data within their workspace and portfolio permissions. Authentication is handled via JWT tokens passed through agent config.Resource Limits
- Default limit: 100 rows
- Maximum limit: 1000 rows per query
- Schema auto-detection works best with workspace context properly configured