Skip to main content
Glama
devCMSS

tds-mcp

by devCMSS

tds-mcp

Servidor MCP que dá a um assistente de IA (Claude Code, Claude Desktop, ou qualquer cliente MCP) a capacidade de compilar fontes AdvPL/TLPP, gerar e aplicar patches e inspecionar o RPO de servidores TOTVS Protheus.

Por baixo usa o advpls — o mesmo TDS Language Server que a extensão tds-vscode utiliza — falando JSON-RPC via stdio. Reaproveita a configuração que você já tem no TDS: servidores, ambientes, includes e tokens.

Não distribui binários da TOTVS. O advpls é localizado na extensão tds-vscode já instalada na sua máquina. Você precisa ter o TDS instalado e um servidor configurado.

Fork. Baseado no tds-mcp do Guilherme Pegoraro. Acrescenta a blindagem contra falso positivo de compilação e a tool tds_rpo_delete — veja Divergências deste fork.

Requisitos

  • Windows (veja Limitações)

  • Node.js 18+

  • Extensão totvs.tds-vscode instalada, com pelo menos um servidor configurado e já conectado uma vez pelo VS Code

  • AppServer Protheus acessível (build 7.00.x)

Related MCP server: vibing-steampunk

Instalação

git clone https://github.com/Guipegoraro/tds-mcp.git
cd tds-mcp
npm install          # o script "prepare" já compila o TypeScript

Registre no Claude Code:

claude mcp add --scope user tds node "<caminho-do-clone>/dist/index.js"

Ou, em qualquer cliente MCP, via configuração JSON:

{
  "mcpServers": {
    "tds": {
      "command": "node",
      "args": ["C:\\caminho\\para\\tds-mcp\\dist\\index.js"]
    }
  }
}

Como a conexão funciona (zero-config)

O MCP lê ~/.totvsls/servers.json — o arquivo global onde o TDS guarda seus servidores. Você não precisa cadastrar nada duas vezes:

Cliente MCP (Claude)
  └── tds-mcp (Node, stdio)
        ├── lê ~/.totvsls/servers.json  (servidores, ambientes, includes, tokens)
        ├── spawn advpls.exe language-server
        └── JSON-RPC: $totvsserver/connect, compilation, patchGenerate, patchApply, ...

Autenticação, em ordem:

  1. Token de reconexão salvo pelo TDS — funciona sem senha nenhuma. Se expirar, basta conectar no servidor pelo VS Code uma vez para renovar.

  2. Credenciais em ~/.tds-mcp/config.json — fallback opcional (veja Configuração).

A conexão do MCP é independente da do VS Code: ambos podem estar conectados ao mesmo tempo.

Tools

Tool

Descrição

Efeito

tds_list_servers

Servidores do servers.json, ambientes e sessão ativa

read-only

tds_use_server

Conecta/autentica em servidor + ambiente

sessão

tds_compile

Compila fontes/pastas no RPO

grava no RPO

tds_syntax_check

Valida sintaxe sem commitar no RPO

nenhum

tds_generate_ppo

Fonte pré-processado (debug de #define/#include)

nenhum

tds_rpo_objects

Lista objetos do RPO (filtro + datas)

read-only

tds_rpo_functions

Lista funções do RPO (fonte + linha)

read-only

tds_rpo_info

Versão do RPO + histórico de patches aplicados

read-only

tds_rpo_delete

Apaga fontes/funções do RPO (dry-run por padrão)

destrutivo

tds_patch_generate

Gera PTM com manifesto e rastreabilidade

read-only no RPO

tds_patch_validate

Valida patch contra o RPO sem aplicar

read-only

tds_patch_info

Lista o conteúdo de um .ptm

read-only

tds_patch_apply

Aplica patch no RPO (deploy)

destrutivo

tds_server_log

Últimas mensagens do advpls (diagnóstico)

read-only

Segurança operacional (leia antes de usar em cliente)

tds_compile, tds_patch_generate e tds_patch_apply alteram o RPO de um servidor real. Recomendação forte: configure seu cliente MCP para sempre pedir confirmação nessas três. No Claude Code, em ~/.claude/settings.json:

{
  "permissions": {
    "ask": [
      "mcp__tds__tds_compile",
      "mcp__tds__tds_patch_generate",
      "mcp__tds__tds_patch_apply",
      "mcp__tds__tds_rpo_delete"
    ]
  }
}

As demais tools são read-only e podem ser liberadas sem risco.

Semântica das datas (importante — evita conclusão errada)

O campo de data que o RPO expõe por objeto (dataFonte em tds_rpo_objects, date em tds_patch_info, rpoDate no manifesto, dataPatch/dataRPO em tds_patch_validate) é o mtime do arquivo-fonte registrado no momento da compilaçãonão o instante em que a compilação ocorreu.

  • dataFonte == mtime do arquivo em disco (±2s) → o RPO contém o conteúdo atual.

  • mtime do disco > dataFonte → fonte alterado depois da última compilação → recompilar.

  • Nunca compare com data de commit git: commit posterior ao mtime é normal (editou num dia, commitou no outro) e não significa RPO desatualizado.

Exceção: tds_rpo_info.dataGeracao e as datas do histórico de patches (geradoEm, aplicadoEm) são datas de evento reais.

Rastreabilidade de patches

Cada tds_patch_generate produz em <patchesRoot>/<cliente>/<ticket>/:

  • DDMMAA_HHMM_<slug>.ptm — data/hora (padrão brasileiro) lideram o nome, ex. 190726_2037_tec10r06.ptm. Colisão no mesmo minuto ganha segundos (DDMMAA_HHMMSS).

  • DDMMAA_HHMM_<slug>.manifest.json — título e descrição recomendados, sha256, fontes com data do RPO, servidor/ambiente/build de origem, autor, commit git (opcional)

  • historico.jsonl — append-only por ticket (gerações, validações, aplicações)

  • <patchesRoot>/historico-global.jsonl — histórico consolidado

Título recomendado (data e hora primeiro): 19/07/2026 20:37 — Cliente ticket — FONTE.PRW

Configuração

Opcional. Copie config.example.json para ~/.tds-mcp/config.json:

{
  "patchesRoot": "C:\\TOTVS\\patches",
  "advplsPath": "",
  "credentials": {
    "NomeDoServidorNoTDS": { "user": "usuario", "password": "senha" }
  }
}
  • patchesRoot — raiz da árvore de patches (padrão C:\TOTVS\patches)

  • advplsPath — só se o advpls não estiver na extensão instalada. Também aceita a variável de ambiente TDS_MCP_ADVPLS

  • credentialssenhas em texto plano. Prefira deixar vazio e usar o token do TDS. O arquivo fica fora do repositório; nunca o versione.

Desenvolvimento e testes

npm run build                                  # compila TypeScript

node test/smoke.mjs <servidor> [ambiente]      # read-only: conecta e inspeciona o RPO
node test/debug-protocol.mjs [host] [porta]    # JSON-RPC cru (diagnóstico de protocolo)

node test/e2e-mcp.mjs <servidor> [ambiente]    # E2E: COMPILA um fonte de teste no RPO
node test/cleanup.mjs <servidor> [ambiente]    # remove o fonte de teste do RPO

O E2E compila test/zTstMcp1.prw (User Function inofensiva) e gera um patch. Use apenas em ambiente de desenvolvimento descartável e rode o cleanup depois.

Divergências deste fork

1. Compilação não retorna mais sucesso sem evidência

O problema. O AppServer pode abortar o build antes de compilar qualquer fonte (RPO travado, ambiente inválido). Nesse caminho ele devolve compileInfos vazio — e o código original derivava sucesso de "nenhum erro no array", produzindo:

{ "totalFontes": 1, "sucesso": true, "erros": 0, "resultados": [] }

...enquanto o log do servidor, no mesmo instante, dizia:

Starting build for environment p12dev.
Start build error: Server returned:
COMPILEERROR-300 Failed to open repository

O fonte não entrou no RPO. Quem confiasse no retorno mandaria rodar uma função inexistente.

A correção. Três regras, em src/verdict.ts:

  1. Falha do servidor é propagada. As mensagens de window/*Message emitidas durante a operação são isoladas por cursor de log e varridas por Start build error, COMPILEERROR-*, PATCHERROR-* e afins. Detectou → sucesso:false, erros>=1, com falhaServidor e logServidor no retorno.

  2. Ausência de evidência nunca é sucesso. resultados vazio com totalFontes > 0 vira indeterminado:true + sucesso:false, com aviso para conferir no RPO.

  3. SKIPPED não é validação. Fonte já compilado volta como SKIPPED / "Source already compiled" — o servidor não o analisou, mas ainda loga "All files compiled successfully". Era o que mascarava erros reais (um C9905 Invalid use of NAMESPACE command só apareceu num recompile forçado). Agora tds_syntax_check usa forcar=true por padrão (seguro: syntaxOnly não grava no RPO) e, se ainda assim vier tudo SKIPPED, devolve sintaxeOk:false + indeterminado:true.

tds_patch_validate / tds_patch_apply receberam a mesma blindagem: resposta ausente ou sem o campo error vira indeterminado, não sucesso. tds_patch_generate aborta se o servidor sinalizou falha, em vez de adotar um .ptm antigo da pasta.

2. Nova tool: tds_rpo_delete

Expõe o Delete source/resource from RPO do TDS ($totvsserver/deletePrograms), que faltava. Necessária para dois casos rotineiros:

  • fonte renomeado (ABC0187.PRWABC0187.tlpp) deixa o antigo no RPO e gera Duplicated function U_ABC0187() ... found in ABC0187.PRW;

  • funções órfãs, compiladas e sem fonte correspondente.

// Simulação (padrão) — mostra o alcance e não apaga nada
tds_rpo_delete({ "programas": ["ABC0187.PRW"] })

// Execução
tds_rpo_delete({ "programas": ["ABC0187.PRW"], "confirmar": true })

Salvaguardas:

  • dry-run por padrão: sem confirmar:true nada é apagado;

  • aceita fonte ou função: U_ABC0187 é resolvido para o fonte que a contém — e o retorno deixa explícito que o fonte inteiro vai embora;

  • blast radius: lista todas as funções que morrem junto antes de você confirmar;

  • recusa alvo inexistente em vez de apagar por engano;

  • verifica depois: relê o RPO e confirma que sumiu, em vez de confiar no returnCode — a mesma lição do bug acima.

Testes

npm run test:verdict   # regressão do falso positivo, com o log real do incidente
npm run test:live      # contra servidor real, só read-only e dry-run (sem efeito colateral)
npm run test:delete    # round-trip do delete — COMPILA E APAGA, só em ambiente descartável

test:live não grava nada no RPO — pode rodar em ambiente de cliente:

node test/live-safe.mjs "MEU SERVIDOR" p12dev C:/fontes/ABC0187.tlpp ABC0187.PRW

test:delete faz o caminho completo (compila test/zTstMcp1.prw, apaga, confirma que sumiu, e checa que apagar o inexistente recusa em vez de fingir sucesso). Só em ambiente de desenvolvimento descartável:

node test/roundtrip-delete.mjs "MEU SERVIDOR DEV" DEV01

Limitações

  • Windows apenas por enquanto: a resolução do binário procura bin/windows/advpls.exe na extensão tds-vscode. O advpls existe para Linux e macOS (@totvs/tds-ls), então o suporte é uma mudança pequena em resolveAdvplsPath() — PRs bem-vindos.

  • O protocolo $totvsserver/* não é um contrato público da TOTVS. Ao atualizar a extensão TDS, o binário muda junto; se algo quebrar, tds_server_log ajuda a diagnosticar. A especificação viva é src/protocolMessages.ts.

  • O advpls não aceita o handshake LSP initialize com params mínimos (derruba o processo com 0xC0000409). Os requests $totvsserver/* são enviados diretamente — é o que o @totvs/tds-languageclient oficial também faz.

  • Fora do escopo da v1 (mas mapeados no protocolo): monitor de usuários conectados, defragRPO, rpoCheckIntegrity, deletePrograms, wsdlGenerate.

Alternativas headless

Se você precisa de CI/CD em vez de um assistente:

  • advpls cli <script.ini> — modo CLI oficial do TDS Language Server (script INI em CP1252)

  • appserver.exe -compile — compilação/patch direto pelo AppServer, usado nos pipelines oficiais da TOTVS (totvs/protheus-ci-universo)

Créditos

Este projeto não é afiliado à TOTVS. O protocolo foi derivado do código-fonte público do tds-vscode (Apache-2.0) e da documentação do tds-ls. Protheus, AdvPL, TLPP e TOTVS são marcas de seus respectivos proprietários.

Licença

MIT — veja LICENSE.

Available Tools

13 tools
tds_compileCompilar fontes AdvPL/TLPPA

Compila fontes ou pastas no RPO do servidor conectado. Retorna status por fonte (SUCCESS/WARN/ERROR/FATAL) com mensagens. Use recompile=true para forçar recompilação.

ParametersJSON Schema
NameRequiredDescriptionDefault
arquivosYesCaminhos de fontes ou pastas
recompileNoForçar recompilação

TDQS

A3.8/5.0
Behavior2/5

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

No annotations provided, so description must convey behavioral traits. It mentions return status per source but does not disclose side effects like overwriting objects, required permissions, or the need for a connected server (though implied). Mutative nature is clear but incomplete.

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?

Two concise sentences, front-loaded with purpose, no redundant information. Every word earns its place.

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

Completeness4/5

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

Covers purpose, parameters, and return format. Lacks explicit mention of prerequisite (connected server) but sibling tool names provide context. Fairly complete given simplicity.

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

Parameters4/5

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

Schema coverage is 100%, and description adds meaning: 'arquivos' can be files or folders, and 'recompile' forces recompilation. Adds value beyond schema defaults.

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

Purpose5/5

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

Clearly states it compiles AdvPL/TLPP source files or folders in the RPO of the connected server. Distinguishes from sibling tools like tds_syntax_check and tds_generate_ppo by focusing on compilation.

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

Usage Guidelines3/5

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

Implies usage for compilation via description, but lacks explicit guidance on when to use vs alternatives (e.g., syntax check) and no exclusion criteria.

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

tds_generate_ppoGerar PPO (fonte pré-processado)A
Read-only

Retorna o fonte após o pré-processador (resolução de #include/#define). Útil para depurar problemas de defines e includes.

ParametersJSON Schema
NameRequiredDescriptionDefault
arquivoYesCaminho do fonte

TDQS

A4.3/5.0
Behavior4/5

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

As anotações já declaram readOnlyHint=true, indicando operação somente leitura. A descrição adiciona valor ao especificar que o retorno é o fonte pré-processado, contextualizando o comportamento além das anotações.

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?

A descrição é composta por apenas duas frases, sem palavras desnecessárias. A primeira frase já informa a função principal, e a segunda fornece o caso de uso. Perfeitamente concisa e bem estruturada.

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

Completeness5/5

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

Dada a baixa complexidade da ferramenta (1 parâmetro obrigatório, sem esquema de saída), a descrição cobre completamente o que o agente precisa saber: o que a ferramenta retorna e por que é útil. Não há lacunas significativas.

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?

A cobertura de descrição do esquema é de 100%; o único parâmetro 'arquivo' já está descrito no esquema como 'Caminho do fonte'. A descrição da ferramenta não adiciona informações extras sobre o parâmetro, então a pontuação permanece no patamar 3 (linha de base para cobertura alta).

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

Purpose5/5

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

A descrição afirma claramente que a ferramenta retorna o fonte após o pré-processador (resolução de #include/#define) e especifica sua utilidade para depurar defines e includes. O nome 'Gerar PPO (fonte pré-processado)' reforça o propósito. Diferencia-se bem de ferramentas irmãs como tds_syntax_check e tds_rpo_objects, que têm finalidades distintas.

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

Usage Guidelines4/5

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

A descrição indica explicitamente quando usar a ferramenta: 'Útil para depurar problemas de defines e includes'. Embora não mencione quando não usar ou alternativas, o contexto é claro o suficiente para um agente IA escolher corretamente entre as ferramentas irmãs.

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

tds_list_serversListar servidores ProtheusA
Read-only

Lista os servidores Protheus do servers.json do TDS (~/.totvsls), com ambientes, includes e qual está conectado nesta sessão do MCP.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

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

Adds context beyond readOnlyHint annotation: specifies data source, content (ambientes, includes), and connection info.

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?

Single sentence, efficient, no redundant words.

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

Completeness5/5

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

Complete for a parameterless read-only tool; explains source and output content.

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

Parameters4/5

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

No parameters; baseline 4. Description adds no parameter info, but none needed.

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

Purpose5/5

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

Describes specific verb 'lista' and resource 'servidores Protheus do servers.json', distinguishes from sibling tools like tds_use_server.

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

Usage Guidelines3/5

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

Implies usage for listing servers, but no explicit guidance on when to use vs alternatives.

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

tds_patch_applyAplicar patch no RPOA
Destructive

APLICA um patch no RPO do ambiente conectado (operação de deploy — altera o ambiente). Por padrão aplica somente fontes mais novos; use aplicarAntigos=true para forçar. Recomenda-se tds_patch_validate antes.

ParametersJSON Schema
NameRequiredDescriptionDefault
arquivoPatchYesCaminho local do .ptm/.upd/.pak
aplicarAntigosNoAplicar mesmo fontes mais antigos que os do RPO

TDQS

A4.4/5.0
Behavior4/5

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

The description matches the destructiveHint annotation by noting it's a deploy operation that changes the environment. It adds useful behavioral context about default newer-only application and the optional override.

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 concise with three sentences, each adding essential information. It is front-loaded with the core action and context, with no unnecessary words.

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

Completeness4/5

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

Given the tool's complexity, destructive annotation, and parameter count, the description covers the core purpose, default behavior, and prerequisite validation. It provides sufficient information for an AI agent, though error conditions are not mentioned.

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

Parameters4/5

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

With 100% schema coverage, the baseline is 3. The description adds value by explaining the default behavior for aplicarAntigos and the file types for arquivoPatch, enhancing understanding beyond the schema.

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

Purpose5/5

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

The description clearly states the tool applies a patch to the RPO as a deploy operation that alters the environment. It distinguishes itself from sibling tools like tds_patch_validate by recommending validation beforehand.

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

Usage Guidelines4/5

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

The description explains the default behavior (only newer fonts) and how to force old fonts with aplicarAntigos=true. It recommends using tds_patch_validate first, providing clear context for usage, though it does not explicitly state when not to use.

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

tds_patch_generateGerar patch (PTM) com rastreabilidadeA

Gera um patch PTM a partir de fontes já compilados no RPO, com organização padrão (///DDMMAA_HHMM_.ptm, datas no padrão brasileiro), manifesto JSON (sha256, fontes, datas do RPO, servidor, autor, git) e histórico. Retorna também título e descrição recomendados — o título começa com data e hora. No manifesto/retorno, rpoDate de cada fonte é o mtime do arquivo-fonte na compilação (semântica de tds_rpo_objects), não o instante da compilação.

ParametersJSON Schema
NameRequiredDescriptionDefault
fontesYesNomes dos objetos no RPO (ex.: TEC10R06.PRW). Devem já estar compilados.
ticketYesTicket/slug da demanda (vira pasta)
clienteYesNome do cliente (vira pasta)
descricaoNoMotivo/resumo da alteração
pastaFontesLocaisNoPasta local dos fontes (para registrar commit git no manifesto)

TDQS

A4.4/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses the rpoDate semantics (mtime not compilation time), output file naming, and manifest content. Adequate behavioral coverage for a generation tool.

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?

Description is dense but efficient, front-loading the action and then detailing specifics. No irrelevant sentences; every line adds value.

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

Completeness4/5

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

No output schema, but description explains return values (title, description, manifest) and input constraints. Could mention error conditions, but overall sufficient for a file generation tool.

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

Parameters4/5

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

Schema coverage is 100%, baseline 3. The description adds context: fontes must be compiled, ticket becomes folder, etc., which adds meaning beyond parameter names and schema descriptions.

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

Purpose5/5

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

The description clearly states the tool generates a PTM patch from compiled sources, with specific output structure and metadata. It distinguishes from siblings like tds_patch_validate or tds_patch_info by focusing on generation.

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

Usage Guidelines4/5

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

The description implies usage context (sources must be compiled) and output specifics, but does not explicitly compare to alternatives or state when not to use.

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

tds_patch_infoInspecionar conteúdo de patchA
Read-only

Lista o conteúdo (fontes, datas, tamanhos) de um arquivo de patch sem aplicá-lo. Auditoria de patch recebido de terceiros. O campo date de cada objeto é o mtime do arquivo-fonte registrado na compilação (mesma semântica de tds_rpo_objects).

ParametersJSON Schema
NameRequiredDescriptionDefault
arquivoPatchYesCaminho local do .ptm/.upd/.pak

TDQS

A4.3/5.0
Behavior4/5

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

Annotations provide readOnlyHint: true, and the description reinforces 'sem aplicá-lo' (without applying). Additionally, it explains the semantics of the 'date' field, referencing tds_rpo_objects, adding useful behavioral context beyond the annotation.

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 extremely concise: two sentences that front-load the core purpose and add a relevant usage context and field semantics note. No redundant information.

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

Completeness5/5

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

Given the simple single-parameter input and no output schema, the description adequately explains what the tool does (lists sources, dates, sizes) and provides enough context (audit use case, date field meaning) for an agent to use it correctly.

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%; the parameter description in the schema already documents 'Caminho local do .ptm/.upd/.pak'. The tool description does not add further parameter-level detail beyond what the schema provides, so baseline 3 applies.

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

Purpose5/5

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

The description clearly states the tool lists contents (sources, dates, sizes) of a patch file without applying it, with a specific use case for auditing third-party patches. It distinguishes from siblings like tds_patch_apply.

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

Usage Guidelines4/5

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

The description specifies the tool is for auditing patches received from third parties, implying inspection rather than application or validation. While it doesn't explicitly list when-not-to-use, the context of sibling tools provides implicit differentiation.

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

tds_patch_validateValidar patch (sem aplicar)A
Read-only

Valida um arquivo de patch contra o RPO do ambiente conectado, sem aplicar. Aponta fontes do patch mais antigos que o RPO. Gate recomendado antes de tds_patch_apply. As datas comparadas (dataPatch/dataRPO) seguem a semântica de mtime do arquivo-fonte na compilação, não do instante de compilação.

ParametersJSON Schema
NameRequiredDescriptionDefault
arquivoPatchYesCaminho local do .ptm/.upd/.pak

TDQS

A4.2/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=true, and description confirms 'sem aplicar'. Adds detail about checking source ages and mtime semantics, providing value beyond annotations.

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?

Two sentences, front-loaded with core purpose. Every sentence adds value: validation without apply, gate recommendation, and date semantics clarification.

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

Completeness4/5

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

Given one parameter, no output schema, and clear annotations, the description is sufficient. It explains what, when, and the date semantics, leaving no major gaps.

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?

Only one parameter, fully described in schema. Description adds no extra meaning beyond what schema already provides. Schema coverage is 100%, so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool validates a patch against the RPO without applying it, and highlights it flags source files older than the RPO. This distinguishes it from siblings like tds_patch_apply and tds_patch_generate.

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

Usage Guidelines4/5

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

Explicitly recommends as a gate before tds_patch_apply, providing clear context for when to use. No explicit exclusions, but the purpose implies when not to use (e.g., when applying is needed).

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

tds_rpo_deleteApagar programas do RPOA
Destructive

DESTRUTIVO — apaga fontes/recursos do RPO do ambiente conectado (equivale ao 'Delete source/resource from RPO' do TDS). Casos de uso: fonte renomeado que deixou o antigo no RPO causando 'Duplicated function', e limpeza de funções órfãs. Aceita nomes de fonte (ABC0187.PRW) ou de função (U_ABC0187) — função é resolvida para o fonte que a contém, e o FONTE INTEIRO é apagado, com todas as suas funções. Por padrão faz SIMULAÇÃO: mostra o que seria apagado e as funções afetadas. Só apaga com confirmar=true. Depois de apagar, relê o RPO para provar que sumiu.

ParametersJSON Schema
NameRequiredDescriptionDefault
confirmarNofalse (padrão) = simulação; true = apaga de fato do RPO
programasYesNomes de fontes no RPO (ex.: ABC0187.PRW) ou de funções (ex.: U_ABC0187)

TDQS

A5/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, describes simulation mode, that deleting a function deletes entire source, and post-deletion re-read. No contradiction with annotations.

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?

Concise, front-loaded with 'DESTRUTIVO', well-structured sentences. Every sentence adds essential information.

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

Completeness5/5

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

Fully covers input, behavior, safety (simulation), and post-deletion verification. No gaps for a destructive tool with two parameters and no output schema.

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

Parameters5/5

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

Schema coverage is 100%, and description adds meaning: explains that programas accepts source or function names, and confirmar default is simulation. Adds value beyond schema.

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

Purpose5/5

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

The description clearly states the tool deletes sources/resources from RPO, specifies use cases (duplicated function, orphan functions), and distinguishes it from sibling tools like tds_compile or tds_rpo_info.

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

Usage Guidelines5/5

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

Explicitly describes when to use (cleanup of orphan/duplicate functions) and how to use (simulation first, confirmar=true to delete). Provides clear context for safe usage.

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

tds_rpo_functionsListar funções do RPOA
Read-only

Lista funções do RPO com fonte e linha onde estão definidas. Use filtro para procurar uma função específica (ex.: 'U_TEC10R06').

ParametersJSON Schema
NameRequiredDescriptionDefault
filtroNoSubstring case-insensitive do nome da função
limiteNoMáximo de itens retornados
apenasPublicasNoOmitir funções privadas/estáticas

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already indicate readOnlyHint=true, and the description adds behavioral context by stating the output includes source and line. It does not contradict annotations.

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 extremely concise with two purposeful sentences, front-loading the tool's purpose and providing a clear usage example without redundancy.

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

Completeness3/5

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

The description explains the output (functions with source and line) but omits details like return format or pagination behavior for the 'limite' parameter. Adequate for a simple list tool.

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 coverage is 100%, with descriptions for all three parameters. The description adds little beyond what the schema provides, earning a baseline score.

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 clearly states it lists RPO functions with source and line, using the verb 'Lista'. It distinguishes from siblings like tds_rpo_objects and tds_rpo_info, though not explicitly mentioning them.

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

Usage Guidelines3/5

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

The description provides a usage example with the filter parameter but does not offer guidance on when to avoid this tool or mention alternative tools for different scopes.

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

tds_rpo_infoInformações do RPOA
Read-only

Versão do RPO, data de geração e histórico de patches aplicados no ambiente conectado. Auditoria pré/pós-deploy.

ParametersJSON Schema
NameRequiredDescriptionDefault
ultimosPatchesNoQuantos patches do histórico retornar

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint: true. Description adds 'Auditoria pré/pós-deploy' indicating historical tracking, and specifies it operates on the connected environment. No contradictory behaviors.

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?

Two short, clear sentences directly describing the tool's output. No unnecessary words or repetition. Front-loaded with key information.

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

Completeness4/5

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

For a read-only tool with one optional parameter and no output schema, the description adequately explains what is returned. Could mention output format or typical use case but not required for completeness.

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 single parameter 'ultimosPatches' is fully described in the schema (100% coverage). The description adds no extra meaning beyond the schema's 'How many patches from history to return', so baseline score applies.

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

Purpose5/5

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

The description clearly states that the tool provides RPO version, generation date, and patch history. It distinguishes itself from siblings like tds_rpo_objects and tds_patch_info by focusing on overall RPO info and audit trail.

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?

No explicit guidance on when to use this tool versus alternatives. Given the many sibling tools (e.g., tds_patch_info for specific patches, tds_rpo_objects for objects), a recommendation would help the agent.

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

tds_rpo_objectsListar objetos do RPOA
Read-only

Lista fontes/recursos do RPO do ambiente conectado. Use filtro para limitar (ex.: 'TEC10'). ATENÇÃO à semântica de dataFonte: é o mtime (data de modificação) do ARQUIVO-FONTE registrado no momento da compilação — NÃO é o instante em que a compilação ocorreu. Uso correto: comparar com o mtime do arquivo em disco — igual (±2s) significa que o RPO contém o conteúdo atual do arquivo; disco mais novo significa fonte alterado depois da última compilação. NÃO compare com data de commit git (commit posterior ao mtime é normal). Sem filtro retorna contagem + primeiros 100.

ParametersJSON Schema
NameRequiredDescriptionDefault
filtroNoSubstring case-insensitive do nome
limiteNoMáximo de itens retornados
incluirRecursosNoIncluir recursos não-fonte (tres)

TDQS

A3.6/5.0
Behavior4/5

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

The description adds critical behavioral context beyond the readOnlyHint annotation by explaining the semantics of dataFonte and warning about common pitfalls. This helps agents use the tool correctly.

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

Conciseness3/5

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

The description is a single dense paragraph. While it includes valuable information, it could be more structured (e.g., bullet points) for easier scanning.

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

Completeness4/5

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

Given the lack of an output schema, the description adequately explains the critical dataFonte semantics and default behavior. However, it does not detail all output fields, which might be necessary for full understanding.

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 coverage is 100% so baseline is 3. The description reinforces the filter example and default behavior (no filter returns count + first 100) but does not add significant new meaning beyond the schema.

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 clearly states it lists sources/resources from the RPO using a filter. However, it does not distinguish itself from sibling tools like tds_rpo_info or tds_rpo_functions that might also list RPO objects.

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

Usage Guidelines3/5

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

Provides an example filter and warns about misinterpreting the dataFonte field (not to compare with git commit). Does not explicitly state when to use this tool versus alternatives or when not to use it.

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

tds_syntax_checkVerificar sintaxe (sem gravar no RPO)A
Read-only

Compila com syntaxOnly: valida os fontes no servidor SEM commitar no RPO. Sem efeito colateral — pode ser usada livremente antes de tds_compile. Fontes já compilados voltam como SKIPPED (o servidor NÃO os valida); por isso forcar=true é o padrão, garantindo checagem real.

ParametersJSON Schema
NameRequiredDescriptionDefault
forcarNoRevalidar mesmo se já compilado (padrão true). false pode devolver SKIPPED sem validar.
arquivosYesCaminhos de fontes ou pastas

TDQS

A4.7/5.0
Behavior5/5

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

The description adds significant value beyond the readOnlyHint annotation by explaining the 'Sem efeito colateral' nature, the SKIPPED behavior, and the rationale for forcar=true. It fully discloses the tool's effects and limitations.

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 three sentences with no wasted words. It front-loads the key behavior (syntax check without commit) and then adds nuance. Every sentence serves a purpose.

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

Completeness5/5

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

Given the tool's simplicity (two parameters, no output schema), the description is complete. It explains what the tool does, when to use it, parameter meaning, and side-effect behavior. The sibling tools provide additional context for when to use this vs others.

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

Parameters4/5

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

Schema coverage is 100% and describes both parameters. The description adds context by explaining the default value of forcar (true) and why it is important (forces real validation). It also links forcar to the SKIPPED behavior, which is not in the schema.

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

Purpose5/5

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

The description clearly states the tool compiles with syntaxOnly, validates sources without committing to RPO, and is safe to use before tds_compile. It distinguishes from siblings by specifying it does not commit and mentions the SKIPPED behavior for already compiled sources.

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

Usage Guidelines4/5

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

The description explicitly says 'Sem efeito colateral — pode ser usada livremente antes de tds_compile', giving clear guidance on when to use. It also explains the forcar parameter's default to avoid SKIPPED. However, it does not explicitly state when not to use it (e.g., when a real compile is needed), but that is implied by sibling tools.

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

tds_use_serverConectar em servidor ProtheusA

Conecta e autentica em um servidor/ambiente do servers.json para as demais tools. Tenta o token de reconexão salvo pelo TDS; se falhar, usa credenciais de ~/.tds-mcp/config.json.

ParametersJSON Schema
NameRequiredDescriptionDefault
ambienteNoAmbiente; padrão: o último usado no TDS
servidorYesNome (ou parte do nome) do servidor no servers.json

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the fallback authentication mechanism but does not mention any side effects, return values, or whether it modifies state (e.g., saving tokens). The transparency is adequate but not comprehensive.

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?

Two sentences concisely convey purpose and authentication behavior. Every sentence adds value; no wasted words.

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

Completeness4/5

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

For a connection tool with simple parameters and no output schema, the description covers the core functionality and authentication flow. It could be slightly more complete by mentioning possible failure modes or return behavior, but overall it is sufficient.

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 coverage is 100% with descriptions for both parameters. The description adds context about 'servidor' being from servers.json and 'ambiente' defaulting to last used, but this is complementary rather than essential beyond the schema.

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

Purpose5/5

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

The description clearly states the tool's purpose: to connect and authenticate to a Protheus server environment for use by other tools. This directly distinguishes it from siblings like tds_compile or tds_syntax_check, which perform different operations.

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

Usage Guidelines4/5

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

The description provides context on authentication flow (tries saved token, then config file), implying it should be used before other tools. However, it does not explicitly state when not to use it or mention alternatives, but the context is clear.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 13 tool updatesv0.2.0
    • First observedtds_compile
    • First observedtds_generate_ppo
    • First observedtds_list_servers
    • First observedtds_patch_apply
    • First observedtds_patch_generate
    • First observedtds_patch_info
    • First observedtds_patch_validate
    • First observedtds_rpo_delete
    • First observedtds_rpo_functions
    • First observedtds_rpo_info
    • First observedtds_rpo_objects
    • First observedtds_syntax_check
    • First observedtds_use_server

TDQS

A4/5.0

Scored across 13 tools

Disambiguation5/5

Every tool targets a distinct operation in the Protheus development workflow: server selection, compilation, syntax checking, RPO analysis, and patch management. No two tools overlap in purpose.

Naming Consistency4/5

Most tools follow a predictable 'tds_verb_noun' or 'tds_noun_verb' pattern (e.g., tds_list_servers, tds_rpo_delete). However, a few tools like 'tds_compile' lack a resource prefix, and 'tds_syntax_check' omits an explicit resource, introducing minor inconsistency.

Tool Count5/5

13 tools is well-scoped for a Protheus MCP server, covering connection, compilation, RPO inspection, and patching without unnecessary bloat. Each tool serves a clear, non-redundant purpose.

Completeness4/5

The tool surface covers core lifecycle operations for Protheus development (compile, syntax check, RPO management, patching). Minor gaps exist, such as no explicit disconnect tool or server configuration editor, but these do not impede typical agent workflows.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers