Pikbase Docs
Open console (opens the console)
Esc

Type to search.

Build

queryEntityDefs() — Schema Manager

Page through the data tables in a tenant.

Contract source@gsb-core/mcp-docs:getDefDocs("queryEntityDefs")

Retrieves a paginated list of entity definitions.

Request Format

queryEntityDefs(
    page: number,           // Page number (1-based)
    pageSize: number,       // Number of items per page
    token: string,          // Authentication token
    tenantCode?: string     // Optional tenant code
): Promise<{
    success: boolean,
    data?: {
        entityDefs: GsbEntityDef[],  // Array of entity definitions
        totalCount: number           // Total number of entity definitions
    },
    error?: string
}>

Response Format

{
    "success": boolean,
    "data": {
        "entityDefs": [
            // Array of entity definition objects
        ],
        "totalCount": number
    },
    "error": "string"      // Present only if success is false
}

Example

// Get the first page with 10 entity definitions per page
const result = await queryEntityDefs(1, 10, "your-auth-token");

// Access the entity definitions and total count
const { entityDefs, totalCount } = result.data;

// Calculate total pages
const totalPages = Math.ceil(totalCount / 10);

Pagination

  • Page numbers start at 1
  • If there are no results for the specified page, an empty array is returned
  • The totalCount field indicates the total number of entity definitions available

Use Cases

  1. Schema Browser: Building a UI to explore available data tables
  2. Data Dictionary: Creating documentation of the data model
  3. Dependency Analysis: Finding relationships between entities
  4. Schema Governance: Monitoring entity definitions for compliance