list-test-cases
List data quality test cases with filters for entity link, test suite, pagination, and field selection.
Instructions
List data quality test cases with filtering
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Comma-separated fields to include | |
| limit | No | Number of results per page | |
| before | No | Cursor for backward pagination | |
| after | No | Cursor for forward pagination | |
| entityLink | No | Filter by entity link (e.g. '<#E::table::service.db.schema.table>') | |
| testSuiteId | No | Filter by test suite UUID | |
| include | No | Include deleted entities | non-deleted |
| extractFields | No | Comma-separated dotted paths to project from response (e.g. 'id,name,owner.name,columns.*.name'). Use `*` as wildcard for arrays/objects. Wrap field names with dots in backticks. Reduces response tokens dramatically on large entities. |
Implementation Reference
- src/tools/data-quality.ts:60-64 (handler)Handler function that executes the list-test-cases tool logic. Calls the OpenMetadata API at /dataQuality/testCases with query params (fields, limit, before, after, entityLink, testSuiteId, include), then applies extractFields to shape the response.
export async function listTestCases(params: z.infer<typeof listTestCasesSchema>) { const { extractFields, ...query } = params; const data = await omClient.get("/dataQuality/testCases", query); return applyExtractFields(data, extractFields ?? LIST_TEST_CASES_DEFAULT_FIELDS); } - src/tools/data-quality.ts:49-58 (schema)Zod schema defining the input parameters for list-test-cases: fields, limit (default 10), before/after cursors, entityLink filter, testSuiteId filter, include (default 'non-deleted'), and extractFields.
export const listTestCasesSchema = z.object({ fields: z.string().optional().describe("Comma-separated fields to include"), limit: z.coerce.number().optional().default(10).describe("Number of results per page"), before: z.string().optional().describe("Cursor for backward pagination"), after: z.string().optional().describe("Cursor for forward pagination"), entityLink: z.string().optional().describe("Filter by entity link (e.g. '<#E::table::service.db.schema.table>')"), testSuiteId: z.string().optional().describe("Filter by test suite UUID"), include: z.enum(["non-deleted", "deleted", "all"]).optional().default("non-deleted").describe("Include deleted entities"), extractFields: z.string().optional().describe(extractFieldsDescription), }); - src/index.ts:384-384 (registration)Registration of the 'list-test-cases' tool in the MCP server using McpServer.tool(), wiring the schema and handler together.
tool("list-test-cases", "List data quality test cases with filtering", listTestCasesSchema.shape, wrapToolHandler(listTestCases)); - src/tools/data-quality.ts:5-5 (helper)Default fields constant used for list-test-cases when no extractFields is provided: includes id, name, fullyQualifiedName, testSuite.fullyQualifiedName, testCaseStatus, testCaseResult, and paging.
const LIST_TEST_CASES_DEFAULT_FIELDS = "data.*.id,data.*.name,data.*.fullyQualifiedName,data.*.testSuite.fullyQualifiedName,data.*.testCaseStatus,data.*.testCaseResult,paging";