aspro_list_methods
List HTTP operations for a specified module, optionally filtered by entity, to discover available API methods and their paths.
Instructions
List operations (HTTP method + path + short description) for a given module and optional entity.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| module | Yes | Module name. | |
| entity | No | Entity name. Omit to list operations across all entities of the module. |
Implementation Reference
- src/index.ts:73-95 (registration)Registration of the 'aspro_list_methods' tool via server.registerTool, with Zod input schema (module required, entity optional) and handler that calls spec.listMethods().
server.registerTool( "aspro_list_methods", { description: "List operations (HTTP method + path + short description) for a given module and optional entity.", inputSchema: { module: z.string().describe("Module name."), entity: z .string() .optional() .describe("Entity name. Omit to list operations across all entities of the module."), }, }, async ({ module, entity }) => { const ops = spec.listMethods(module, entity); if (ops.length === 0) { return asJson({ error: `No operations found for module="${module}"${entity ? `, entity="${entity}"` : ""}.`, }); } return asJson({ count: ops.length, operations: ops.map(summarizeOp) }); }, ); - src/index.ts:86-94 (handler)Handler function for aspro_list_methods: calls spec.listMethods(module, entity), returns error if empty or a JSON summary of operations.
async ({ module, entity }) => { const ops = spec.listMethods(module, entity); if (ops.length === 0) { return asJson({ error: `No operations found for module="${module}"${entity ? `, entity="${entity}"` : ""}.`, }); } return asJson({ count: ops.length, operations: ops.map(summarizeOp) }); }, - src/spec.ts:172-178 (helper)SpecIndex.listMethods() — the core helper that filters operations by module and optional entity, then sorts by entity and method.
listMethods(module: string, entity?: string): OperationSpec[] { return this.operations .filter((o) => o.module === module && (entity ? o.entity === entity : true)) .sort((a, b) => a.entity.localeCompare(b.entity) || a.method.localeCompare(b.method), ); } - src/spec.ts:27-40 (schema)OperationSpec interface — the type definition for each operation returned by listMethods.
export interface OperationSpec { module: string; entity: string; method: string; path: string; httpMethod: HttpMethod; description?: string; tags: string[]; parameters: ParameterSpec[]; bodyContentType?: string; bodyProperties: BodyPropSpec[]; bodyRequired: string[]; responses: Record<string, unknown>; } - src/index.ts:32-41 (helper)summarizeOp() helper used to map OperationSpec objects into a concise summary for the tool response.
function summarizeOp(op: OperationSpec) { return { module: op.module, entity: op.entity, method: op.method, httpMethod: op.httpMethod, path: op.path, description: op.description, }; }