pje_listar_processos
List judicial processes from Brazil's PJE system with optional filters, page numbers, and result sizes to organize legal case searches.
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-468 (handler)MCP tool handler function that destructures arguments, calls PJEClient.listarProcessos, and returns a formatted text response with the JSON result.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:161-179 (helper)Core implementation in PJEClient that constructs query parameters and makes HTTP GET request to /api/v1/processos endpoint.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; }
- src/index.ts:241-248 (schema)Input schema definition for the pje_listar_processos tool, specifying optional filter, page, and size parameters.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)Handler registration in the CallToolRequest switch statement, checking client configuration and delegating to 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:238-249 (registration)Tool registration in the ListTools response array, defining name, description, and schema.{ 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" }, }, }, },