Skip to main content
Glama

pje_configurar_certificado

Configure digital certificate authentication for accessing Brazilian judicial data through the PJE system, supporting A1 and A3 certificates with PFX files or Windows certificate store parameters.

Instructions

Configura autenticação por certificado digital

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pfxPathNoCaminho para arquivo .pfx/.p12
pfxPasswordNoSenha do arquivo .pfx/.p12
certificateThumbprintNoThumbprint do certificado no Windows
certificateSubjectNoSubject do certificado no Windows

Implementation Reference

  • The main handler function for the 'pje_configurar_certificado' tool. Configures a digital certificate using thumbprint and password, initializes it for the PJE client, and attempts authentication.
    private async configurarCertificado(args: any) {
      try {
        const thumbprint = args.certificateThumbprint || process.env.PJE_CERTIFICATE_THUMBPRINT;
        const password = args.certificatePassword || process.env.PJE_CERTIFICATE_PASSWORD;
        if (!thumbprint || !password) {
          throw new Error('Thumbprint e senha do certificado são obrigatórios');
        }
        const certificateConfig: CertificateConfig = {
          certificateThumbprint: thumbprint,
          certificatePassword: password
        };
    
        if (!this.pjeClient) {
          const config: PJEConfig = {
            baseUrl: process.env.PJE_BASE_URL || "https://pje.tjce.jus.br",
            appName: process.env.PJE_APP_NAME || "pje-tjce-1g",
            certificate: certificateConfig,
          };
          this.pjeClient = new PJEClient(config);
        } else {
          (this.pjeClient as any).config.certificate = certificateConfig;
          (this.pjeClient as any).certificateManager = new CertificateManager(certificateConfig);
        }
    
        await this.pjeClient.initializeCertificate();
        
        try {
          await this.pjeClient.authenticateWithCertificate();
          return {
            content: [
              {
                type: "text",
                text: `🔐 **Certificado Digital Configurado com Sucesso!**\n\n✅ Certificado carregado e autenticado\n🎯 Pronto para usar com todas as funcionalidades do PJE\n\n**Informações do Certificado:**\n${JSON.stringify(this.pjeClient.getCertificateInfo(), null, 2)}`,
              },
            ],
          };
        } catch (authError) {
          return {
            content: [
              {
                type: "text",
                text: `⚠️ **Certificado Carregado, mas Autenticação Falhou**\n\nCertificado foi carregado, mas a autenticação no PJE falhou.\nErro: ${authError}\n\n**Informações do Certificado:**\n${JSON.stringify(this.pjeClient.getCertificateInfo(), null, 2)}`,
              },
            ],
          };
        }
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `❌ **Erro ao Configurar Certificado Digital**\n\n${error instanceof Error ? error.message : String(error)}\n\n**Dicas:**\n1. Verifique se o arquivo .pfx existe no caminho especificado\n2. Confirme se a senha do certificado está correta\n3. Para certificados do Windows, use o thumbprint ou subject\n4. Execute 'pje_listar_certificados' para ver certificados disponíveis`,
            },
          ],
        };
      }
    }
  • src/index.ts:326-356 (registration)
    The request handler for CallToolRequestSchema includes a switch case that dispatches 'pje_configurar_certificado' calls to the configurarCertificado method.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        switch (request.params.name) {
          case "pje_configurar":
            return await this.configurarPJE(request.params.arguments);
          case "pje_listar_processos":
            if (!this.pjeClient) throw new Error("PJE não configurado");
            return await this.listarProcessos(request.params.arguments);
          case "pje_buscar_processo":
            if (!this.pjeClient) throw new Error("PJE não configurado");
            return await this.buscarProcesso(request.params.arguments);
          case "pje_listar_orgaos_julgadores":
            if (!this.pjeClient) throw new Error("PJE não configurado");
            return await this.listarOrgaosJulgadores();
          case "pje_listar_classes":
            if (!this.pjeClient) throw new Error("PJE não configurado");
            return await this.listarClasses();
          case "pje_listar_assuntos":
            if (!this.pjeClient) throw new Error("PJE não configurado");
            return await this.listarAssuntos();
          case "pje_status":
            return await this.verificarStatus();
          case "pje_configurar_certificado":
            return await this.configurarCertificado(request.params.arguments);
          case "pje_listar_certificados":
            return await this.listarCertificados();
          case "pje_info_certificado":
            return await this.infoCertificado();
          default:
            throw new Error(`Ferramenta desconhecida: ${request.params.name}`);
        }
  • src/index.ts:293-305 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: "pje_configurar_certificado",
      description: "Configura autenticação por certificado digital",
      inputSchema: {
        type: "object",
        properties: {
          pfxPath: { type: "string", description: "Caminho para arquivo .pfx/.p12" },
          pfxPassword: { type: "string", description: "Senha do arquivo .pfx/.p12" },
          certificateThumbprint: { type: "string", description: "Thumbprint do certificado no Windows" },
          certificateSubject: { type: "string", description: "Subject do certificado no Windows" },
        },
      },
    },
  • Input schema defining parameters for configuring the certificate: pfxPath, pfxPassword, certificateThumbprint, certificateSubject.
    inputSchema: {
      type: "object",
      properties: {
        pfxPath: { type: "string", description: "Caminho para arquivo .pfx/.p12" },
        pfxPassword: { type: "string", description: "Senha do arquivo .pfx/.p12" },
        certificateThumbprint: { type: "string", description: "Thumbprint do certificado no Windows" },
        certificateSubject: { type: "string", description: "Subject do certificado no Windows" },
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Configura' implies a write/mutation operation that likely changes system state, but the description doesn't specify whether this is persistent, reversible, requires admin privileges, affects other operations, or has side effects. It mentions authentication but doesn't clarify what gets configured (client settings, session, system-wide). Significant behavioral gaps remain.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a configuration tool and front-loads the essential information. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after configuration (success indicators, error conditions), whether configuration persists across sessions, or how this interacts with other PJE tools. The description alone leaves too many operational questions unanswered given the tool's complexity and lack of supporting structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no parameter-specific information beyond the general purpose of configuring certificate authentication. It doesn't explain parameter relationships (e.g., pfxPath/pfxPassword vs certificateThumbprint/certificateSubject as alternative approaches) or usage constraints. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Configura autenticação por certificado digital' clearly states the action (configures) and resource (digital certificate authentication). It distinguishes from siblings like pje_configurar (general configuration) and pje_info_certificado (certificate information) by focusing specifically on authentication setup. However, it doesn't explicitly mention what system or context this configuration applies to.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a certificate file or Windows certificate store access), when this configuration is required versus other authentication methods, or how it relates to siblings like pje_listar_certificados (which might show available certificates). Usage context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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