Skip to main content
Glama

pje_configurar

Configure the connection to the Brazilian Electronic Judicial Process (PJE) system by setting the API base URL and application name, enabling integration with A1 and A3 digital certificates for judicial data access.

Instructions

Configura a conexão com o PJE

Input Schema

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

Implementation Reference

  • The main handler function for the 'pje_configurar' tool. It configures the PJEClient with provided arguments or environment variables, handles certificate initialization and authentication if applicable, and returns a status message.
    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`, }, ], }; }
  • The input schema definition for the 'pje_configurar' tool, specifying parameters like baseUrl and appName.
    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:329-330 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement.
    case "pje_configurar": return await this.configurarPJE(request.params.arguments);
  • src/index.ts:227-237 (registration)
    Tool registration in the ListToolsRequestSchema response, including name, description, and schema.
    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"], }, },

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