Skip to main content
Glama

pje_configurar

Configure connection settings for the Brazilian Electronic Judicial Process (PJE) system to enable API access and judicial data integration.

Instructions

Configura a conexão com o PJE

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseUrlYesURL base da API do PJE
appNameNoNome da aplicação

Implementation Reference

  • Main handler function that configures the PJEClient with provided arguments, attempts certificate authentication (hardcoded thumbprint/password), falls back to SSO or public access, and returns formatted status text.
    private async configurarPJE(args: any) {
      const config: PJEConfig = {
        baseUrl: args.baseUrl || process.env.PJE_BASE_URL || "https://pje.tjce.jus.br",
        appName: args.appName || process.env.PJE_APP_NAME || "pje-tjce-1g",
        ssoUrl: args.ssoUrl || process.env.PJE_SSO_URL,
        clientId: args.clientId || process.env.PJE_CLIENT_ID,
        clientSecret: args.clientSecret || process.env.PJE_CLIENT_SECRET,
        username: args.username || process.env.PJE_USERNAME,
        password: args.password || process.env.PJE_PASSWORD,
      };
      
      const certificateConfig: CertificateConfig = {
        certificateThumbprint: '7db4b6cc9de4785944bcf1c8f3cde03355733b84',
        certificatePassword: '123456'
      };
    
      this.pjeClient = new PJEClient(config);
    
      if (certificateConfig) {
        try {
          await this.pjeClient.initializeCertificate();
          try {
            await this.pjeClient.authenticateWithCertificate();
            return {
              content: [
                {
                  type: "text",
                  text: `✅ PJE configurado com sucesso!\n\n🎯 **Configuração:**\n- URL: ${config.baseUrl}\n- App: ${config.appName}\n- Autenticação: 🔐 Certificado Digital\n\n✅ **Pronto para usar todas as funcionalidades!**`,
                },
              ],
            };
          } catch (authError) {
            return {
              content: [
                {
                  type: "text",
                  text: `⚠️ PJE configurado com certificado!\n\n🎯 **Configuração:**\n- URL: ${config.baseUrl}\n- App: ${config.appName}\n- Certificado: ✅ Carregado\n- Autenticação: ⚠️ Falha na autenticação\n\n**Erro:** ${authError instanceof Error ? authError.message : String(authError)}`,
                },
              ],
            };
          }
        } catch (certError) {
          return {
            content: [
              {
                type: "text",
                text: `❌ PJE configurado sem certificado!\n\n🎯 **Configuração:**\n- URL: ${config.baseUrl}\n- App: ${config.appName}\n- Certificado: ❌ Erro ao carregar\n\n**Erro:** ${certError instanceof Error ? certError.message : String(certError)}`,
              },
            ],
          };
        }
      }
    
      if (config.ssoUrl && config.clientId && config.clientSecret && config.username && config.password) {
        try {
          await this.pjeClient.authenticate();
          return {
            content: [
              {
                type: "text",
                text: `✅ PJE configurado com sucesso!\n\n🎯 **Configuração:**\n- URL: ${config.baseUrl}\n- App: ${config.appName}\n- Autenticação: ✅ SSO autenticado\n\n✅ **Pronto para usar todas as funcionalidades!**`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `⚠️ PJE configurado com erro na autenticação!\n\n🎯 **Configuração:**\n- URL: ${config.baseUrl}\n- App: ${config.appName}\n- Autenticação: ❌ Falha no SSO\n\n❌ **Erro:** ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    
      return {
        content: [
          {
            type: "text",
            text: `✅ PJE configurado!\n\n🎯 **Configuração:**\n- URL: ${config.baseUrl}\n- App: ${config.appName}\n- Autenticação: ⚠️ Apenas consultas públicas\n\n💡 **Para funcionalidades completas:**\nConfigure certificado digital ou credenciais no arquivo .env`,
          },
        ],
      };
    }
  • Tool schema definition including name, description, and input schema requiring baseUrl.
    {
      name: "pje_configurar",
      description: "Configura a conexão com o PJE",
      inputSchema: {
        type: "object",
        properties: {
          baseUrl: { type: "string", description: "URL base da API do PJE" },
          appName: { type: "string", description: "Nome da aplicação" },
        },
        required: ["baseUrl"],
      },
    },
  • src/index.ts:328-330 (registration)
    Registration of the tool handler in the CallToolRequest switch statement, dispatching to configurarPJE method.
    switch (request.params.name) {
      case "pje_configurar":
        return await this.configurarPJE(request.params.arguments);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool configures a connection but doesn't explain what this entails—whether it's a one-time setup, if it persists across sessions, what permissions are required, or potential side effects. This is inadequate for a configuration tool with zero annotation coverage.

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, concise sentence in Portuguese that directly states the tool's purpose without unnecessary words. It's front-loaded and efficient, making it easy for an agent to parse quickly.

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?

Given the complexity of a configuration tool with no annotations and no output schema, the description is insufficient. It doesn't cover what the configuration does, how it affects other tools, or what success/failure looks like. For a tool that likely sets up critical API connections, more context is needed.

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?

The schema description coverage is 100%, with clear descriptions for both parameters ('baseUrl' and 'appName'). The description adds no additional meaning beyond the schema, such as explaining the purpose of 'appName' or providing examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose3/5

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

The description 'Configura a conexão com o PJE' clearly states the tool configures a connection to PJE, which is a specific action. However, it doesn't distinguish this from sibling tools like 'pje_configurar_certificado' (which configures certificates specifically) or explain what type of connection is being configured, leaving some ambiguity.

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 this configuration before using other PJE tools), exclusions, or clarify its role relative to siblings like 'pje_configurar_certificado', leaving the agent with no usage context.

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