dynamics_list_tables
Retrieve and filter Dynamics CRM entity tables to identify custom or specific data structures for development and integration workflows.
Instructions
Lista tabelas (entidades) do Dynamics CRM
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filtro OData | |
| customOnly | No | Apenas tabelas customizadas | |
| top | No |
Implementation Reference
- src/tools/schema/index.ts:277-303 (handler)The implementation of the `dynamics_list_tables` tool, including the definition, schema validation, and handler logic.
server.tool( "dynamics_list_tables", "Lista tabelas (entidades) do Dynamics CRM", ListTablesSchema.shape, async (params: z.infer<typeof ListTablesSchema>) => { const filters: string[] = []; if (params.customOnly) { filters.push("IsCustomEntity eq true"); } if (params.filter) { filters.push(params.filter); } const result = await client.get<{ value: Record<string, unknown>[] }>( `EntityDefinitions?$select=LogicalName,SchemaName,DisplayName,EntitySetName,Description,IsCustomEntity,OwnershipType,PrimaryIdAttribute,PrimaryNameAttribute&$filter=${filters.join(" and ")}&$top=${params.top}` ); return { content: [ { type: "text" as const, text: `Tabelas encontradas: ${result.value.length}\n\n${JSON.stringify(result.value, null, 2)}`, }, ], }; } ); - src/tools/schema/index.ts:44-48 (schema)The Zod schema definition for input validation for the `dynamics_list_tables` tool.
export const ListTablesSchema = z.object({ filter: z.string().optional().describe("Filtro OData"), customOnly: z.boolean().default(true).describe("Apenas tabelas customizadas"), top: z.number().default(50), });