Database
Register the database tool suite to discover SQLite databases, inspect schema, and run read-only queries inside the app sandbox.
Install
dotnet add package Ansight.Tools.Database
Register the Suite
using Ansight;
using Ansight.Tools.Database;
var options = Options.CreateBuilder()
.WithDatabaseTools()
.WithReadOnlyToolAccess()
.Build();
Registration API
WithDatabaseTools(): registers the SQLite discovery, schema, and read-only query tools. No suite-specific configuration is currently required.
Specific Concerns
- The suite is SQLite-focused.
- Paths must stay inside approved sandbox roots.
- Query execution is read-only by design.
- Schema and query results can expose sensitive user or app data.
Default search roots include:
- Android:
appData,cache,temp - iOS and Mac Catalyst:
appData,documents,cache,temp
Tool Matrix
| Name | Id | Scope | Description | Security |
|---|---|---|---|---|
List Databases | data.list_databases | Read | Lists the known app databases that can be inspected. | Moderate |
Describe Schema | data.describe_schema | Read | Returns schema metadata for a database or table. | Moderate |
Query Database | data.query | Read | Executes a constrained read query against an app database. | High |
List Databases
Arguments:
includeSystemStores: include cache and system-store databasesmaxResults: maximum number of matches
Returns:
databasestruncatedcapturedAtUtc
Example:
{
"toolId": "data.list_databases",
"arguments": {
"includeSystemStores": false,
"maxResults": 100
}
}
Describe Schema
Arguments:
path: required absolute or sandbox-relative database pathdatabase: alternate field name for the same pathtable: optional table filter
Returns:
databasePathtablescapturedAtUtc
Example:
{
"toolId": "data.describe_schema",
"arguments": {
"path": "my-app.db",
"table": "users"
}
}
Query Database
Arguments:
path: required absolute or sandbox-relative database pathdatabase: alternate field name for the same pathsql: required read-only SQL statementmaxRows: maximum rows to return, default100
Returns:
databasePathsqlcolumnsrowstruncatedcapturedAtUtc
Example:
{
"toolId": "data.query",
"arguments": {
"path": "my-app.db",
"sql": "select id, email from users order by created_at desc limit 20",
"maxRows": 20
}
}