pje_listar_certificados
List available digital certificates on Windows to access Brazilian judicial data through the PJE system.
Instructions
Lista certificados digitais disponíveis no Windows
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:648-669 (handler)The handler function that implements the core logic of the 'pje_listar_certificados' tool. It runs 'certutil -store My' to list certificates from the Windows 'My' store and formats the stdout as a text response, with error handling.private async listarCertificados() { try { const { stdout } = await execAsync('certutil -store My'); return { content: [ { type: "text", text: `🔍 **Certificados Digitais Disponíveis no Windows**\n\n${stdout}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `❌ **Erro ao Listar Certificados**\n\n${error instanceof Error ? error.message : String(error)}\n\n**Nota:** Esta funcionalidade requer Windows e acesso ao Certificate Store.`, }, ], }; } }
- src/index.ts:306-313 (registration)Tool registration entry in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (empty object, no parameters required).{ name: "pje_listar_certificados", description: "Lista certificados digitais disponíveis no Windows", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:350-351 (registration)Switch case in the CallToolRequestSchema handler that routes calls to the 'pje_listar_certificados' tool to its implementation method.case "pje_listar_certificados": return await this.listarCertificados();
- src/index.ts:309-312 (schema)Input schema definition for the tool: an empty object, indicating no input parameters are expected.inputSchema: { type: "object", properties: {}, },
- src/utils.ts:1-4 (helper)Helper utility 'execAsync' imported and used in the handler to execute the 'certutil' command asynchronously.import { exec } from 'child_process'; import { promisify } from 'util'; export const execAsync = promisify(exec);