get-api-collection-by-name
Retrieve an API Collection using its fully qualified name from OpenMetadata 1.12+.
Instructions
Get an API Collection by fully qualified name (OM 1.12+)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fqn | Yes | API Collection fully qualified name | |
| fields | No | Comma-separated fields to include | |
| include | No | ||
| 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/index.ts:447-447 (registration)Registration of the get-api-collection-by-name tool using the tool() function with schema and handler.
tool("get-api-collection-by-name", "Get an API Collection by fully qualified name (OM 1.12+)", getApiCollectionByNameSchema.shape, wrapToolHandler(getApiCollectionByName)); - Zod schema for getApiCollectionByName: validates fqn (required), fields, include, and extractFields parameters.
export const getApiCollectionByNameSchema = z.object({ fqn: z.string().describe("API Collection fully qualified name"), fields: z.string().optional().describe("Comma-separated fields to include"), include: listIncludeEnum.optional(), extractFields: z.string().optional().describe(extractFieldsDescription), }); - src/tools/governance-entities.ts:172-177 (handler)Handler function: calls GET /apiCollections/name/{fqn} via omClient, optionally applies extractFields.
export async function getApiCollectionByName(params: z.infer<typeof getApiCollectionByNameSchema>) { const { fqn, extractFields, ...query } = params; const data = await omClient.get(`/apiCollections/name/${encodeURIComponent(fqn)}`, query); if (extractFields) return data; return applyExtractFields(data, DEFAULTS.apiCollection.get); } - src/index.ts:140-142 (helper)Import of getApiCollectionByNameSchema and getApiCollectionByName from governance-entities.ts
listApiCollectionsSchema, listApiCollections, getApiCollectionByNameSchema, getApiCollectionByName, listApiEndpointsSchema, listApiEndpoints, getApiEndpointByNameSchema, getApiEndpointByName, } from "./tools/governance-entities.js";