pje_listar_processos
Retrieve and filter judicial processes from the Brazilian PJE system using optional parameters like search terms, page number, and page size, facilitated by the PJE MCP Server.
Instructions
Lista processos com filtros opcionais
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filtro para busca | |
| page | No | Número da página | |
| size | No | Tamanho da página |
Implementation Reference
- src/index.ts:456-467 (handler)The main handler function for the 'pje_listar_processos' tool in PJEServer class. Extracts filter, page, size from arguments, calls PJEClient.listarProcessos, and returns formatted text response.private async listarProcessos(args: any) { const { filter, page, size } = args; const result = await this.pjeClient!.listarProcessos(filter, undefined, undefined, page, size); return { content: [ { type: "text", text: `📋 **Processos encontrados:**\n\n${JSON.stringify(result, null, 2)}`, }, ], };
- src/index.ts:239-249 (schema)Input schema definition for the 'pje_listar_processos' tool, specifying optional filter, page, and size parameters.name: "pje_listar_processos", description: "Lista processos com filtros opcionais", inputSchema: { type: "object", properties: { filter: { type: "string", description: "Filtro para busca" }, page: { type: "number", description: "Número da página" }, size: { type: "number", description: "Tamanho da página" }, }, }, },
- src/index.ts:331-333 (registration)Registration of the tool handler in the CallToolRequestSchema switch statement within setupToolHandlers(). Dispatches to the listarProcessos method.case "pje_listar_processos": if (!this.pjeClient) throw new Error("PJE não configurado"); return await this.listarProcessos(request.params.arguments);
- src/index.ts:161-179 (helper)Helper method in PJEClient class that constructs query parameters and makes the API GET request to /api/v1/processos to list processes.async listarProcessos(filter?: any, fields?: string[], order?: any, page?: number, size?: number): Promise<PJEResponse> { const params: any = {}; if (filter) { params.filter = typeof filter === "string" ? filter : JSON.stringify(filter); } if (fields) { params.fields = Array.isArray(fields) ? JSON.stringify(fields) : fields; } if (order) { params.order = typeof order === "string" ? order : JSON.stringify(order); } if (page || size) { params.page = JSON.stringify({ page: page || 1, size: size || 20 }); } const response = await this.axiosInstance.get("/api/v1/processos", { params }); return response.data; }