get-database
Retrieve detailed metadata for a database using its UUID. Access specific fields and control inclusion of deleted entries.
Instructions
Get database details by UUID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Database UUID | |
| fields | No | ||
| include | No |
Implementation Reference
- src/tools/databases.ts:18-22 (schema)Input schema for the 'get-database' tool: accepts a 'id' (UUID string), optional 'fields', and optional 'include' enum.
export const getDatabaseSchema = z.object({ id: z.string().describe("Database UUID"), fields: z.string().optional(), include: z.enum(["non-deleted", "deleted", "all"]).optional(), }); - src/tools/databases.ts:24-27 (handler)Handler function that extracts 'id' from params and calls omClient.get() with the remaining query params to fetch a database by UUID.
export async function getDatabase(params: z.infer<typeof getDatabaseSchema>) { const { id, ...query } = params; return omClient.get(`/databases/${id}`, query); } - src/index.ts:186-186 (registration)Registration of the 'get-database' tool on the MCP server with its schema and handler wrapped in error handling.
tool("get-database", "Get database details by UUID", getDatabaseSchema.shape, wrapToolHandler(getDatabase)); - src/index.ts:21-25 (helper)Import statement bringing getDatabaseSchema and getDatabase from the tools/databases module into the registration file.
import { listDatabasesSchema, listDatabases, getDatabaseSchema, getDatabase, getDatabaseByNameSchema, getDatabaseByName, createDatabaseSchema, createDatabase, updateDatabaseSchema, updateDatabase, deleteDatabaseSchema, deleteDatabase, } from "./tools/databases.js";