Skip to main content
Glama

pje_info_certificado

Display configured certificate information for accessing Brazilian judicial data through the PJE system, supporting A1 and A3 digital certificates.

Instructions

Mostra informações sobre o certificado configurado

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic: checks if a certificate is configured, retrieves certificate info using pjeClient.getCertificateInfo(), formats a detailed text response with subject, issuer, technical details, and validity status, and returns it as MCP content.
    private async infoCertificado() {
      try {
        if (!this.pjeClient || !(this.pjeClient as any).certificateManager) {
          return {
            content: [
              {
                type: "text",
                text: `❌ **Nenhum Certificado Configurado**\n\nExecute 'pje_configurar_certificado' primeiro para carregar um certificado digital.`,
              },
            ],
          };
        }
        
        const info = this.pjeClient.getCertificateInfo();
        
        let texto = `🎯 **Informações do Certificado Digital Atual**\n\n`;
        
        texto += `**Subject:**\n`;
        info.subject.forEach((attr: any) => {
          texto += `- ${attr.name}: ${attr.value}\n`;
        });
        
        texto += `\n**Emissor:**\n`;
        info.issuer.forEach((attr: any) => {
          texto += `- ${attr.name}: ${attr.value}\n`;
        });
        
        texto += `\n**Detalhes Técnicos:**\n`;
        texto += `- Serial Number: ${info.serialNumber}\n`;
        texto += `- Thumbprint: ${info.thumbprint}\n`;
        texto += `- Válido de: ${new Date(info.notBefore).toLocaleString('pt-BR')}\n`;
        texto += `- Válido até: ${new Date(info.notAfter).toLocaleString('pt-BR')}\n`;
        
        const agora = new Date();
        const validade = new Date(info.notAfter);
        
        if (agora > validade) {
          texto += `\n⚠️ **AVISO: Certificado EXPIRADO!**\n`;
        } else {
          const diasRestantes = Math.floor((validade.getTime() - agora.getTime()) / (1000 * 60 * 60 * 24));
          texto += `\n✅ **Certificado válido por mais ${diasRestantes} dias**\n`;
        }
        
        return {
          content: [
            {
              type: "text",
              text: texto,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `❌ **Erro ao Obter Informações do Certificado**\n\n${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • src/index.ts:314-321 (registration)
    Tool registration in the ListTools handler, defining name, description, and input schema (empty object, no parameters required).
    {
      name: "pje_info_certificado",
      description: "Mostra informações sobre o certificado configurado",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:352-353 (registration)
    Tool dispatch registration in the CallToolRequestHandler switch statement, routing calls to the infoCertificado method.
    case "pje_info_certificado":
      return await this.infoCertificado();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chapirousIA/pje-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server