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.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true. The description adds behavioral context: it resolves preprocessor directives and returns the preprocessed source, which goes 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 two concise sentences with no unnecessary words. It efficiently conveys the purpose and usage.

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 simplicity (one parameter, no nested objects, no output schema), the description and schema are sufficient. The use case is explicitly mentioned.

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 'arquivo' is described as 'Caminho do fonte'). The description does not add extra meaning to the parameter, 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 function: returns the source after preprocessing (resolving #include/#define). This distinguishes it from siblings like tds_compile or tds_syntax_check.

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 indicates when to use the tool: for debugging define and include issues. It implies appropriate usage context though it does not list exclusions.

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.2/5.0
Behavior4/5

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

The destructiveHint annotation already signals this is a destructive operation. The description adds behavioral context by stating it alters the environment and clarifying the version-checking logic (default skip older fonts, force with flag). 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?

Two concise sentences. The first sentence clearly states purpose and effect. The second sentence explains default behavior, the override flag, and a recommendation. No unnecessary words or repetition.

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?

The description covers the tool's effect (alter environment), default behavior, and the force flag. It recommends validation beforehand. However, it does not describe return values or error handling, and could mention that it operates on the currently connected environment (implied by 'ambiente conectado').

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 meaning of 'aplicarAntigos' by explaining its effect, but does not add significant new information beyond the schema descriptions. The parameter 'arquivoPatch' is only mentioned implicitly in the context of applying a patch.

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 verb 'APLICA' and the resource 'patch no RPO', specifying it is a deploy operation that alters the environment. It distinguishes from siblings by referencing tds_patch_validate and explaining default behavior regarding newer fonts.

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 recommends using tds_patch_validate before this tool, providing a clear usage sequence. It explains the default behavior (apply only newer fonts) and how to override with aplicarAntigos=true. However, it does not explicitly contrast with other sibling tools like tds_patch_generate or tds_patch_info for alternative use cases.

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

A3.6/5.0
Behavior3/5

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

Given no annotations, the description provides useful behavioral details: output path format, manifest contents, and mtime semantics. However, it does not disclose overwrite behavior, required permissions, or error handling, which are important 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.

Conciseness4/5

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

The description is concise (about 3 sentences) and front-loaded with the purpose. It packs essential information efficiently. Minor improvement could be structuring into points, but it is effective.

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 covers output path, manifest details, and return of title/description. However, it lacks detail on the exact return structure (e.g., patch file vs. path) and does not specify error conditions or required state, which would be helpful given no output schema.

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%. The description adds value by explaining how 'cliente' and 'ticket' become folder names and how 'pastaFontesLocais' is used for git commit, providing semantic context 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 generates PTM patches from already compiled RPO sources, with a specific output organization and additional metadata (title, description). This distinguishes it from sibling tools like tds_patch_validate and tds_patch_info.

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 mentions that sources must already be compiled (prerequisite), but lacks explicit guidance on when to use this tool versus alternatives like tds_compile or other patch tools. No when-not-to-use or context for choosing among siblings.

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 that the patch is not applied. It adds behavioral detail that the 'date' field uses the same mtime semantics as tds_rpo_objects, which is useful 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 two sentences: the first states the primary action and content, the second provides usage context and a clarification about date semantics. It is concise, front-loaded, and every sentence adds value.

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?

For a simple inspection tool with one parameter, no output schema, and readOnly annotations, the description fully covers what the tool lists, the use case (auditing), and clarifies a specific data field. No gaps remain.

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 a clear description for the single parameter 'arquivoPatch'. The description does not add further parameter semantics, but the schema already fully documents it, meeting the baseline.

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 verb 'Lista' (lists) and the resource 'conteúdo de um arquivo de patch'. It specifies the content types (fontes, datas, tamanhos) and emphasizes it does not apply the patch, distinguishing it from siblings like tds_patch_apply and tds_patch_validate.

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 phrase 'Auditoria de patch recebido de terceiros' indicates the tool's purpose for auditing third-party patches. While it does not explicitly state when not to use, the context implies this is for inspection, contrasting with application or validation.

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 declare readOnlyHint=true, and description confirms non-destructive behavior ('sem aplicar'). Adds behavioral details: compares source file mtime and points out older sources. No contradiction.

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 main purpose, no unnecessary words. Every sentence adds value: purpose, usage, and important date semantics.

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 simple tool with one well-documented parameter and readOnlyHint annotation, description covers purpose, usage, and a key behavioral detail. Missing explicit mention of return value/format, but the output is implied ('aponta fontes...').

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 a clear description of the parameter 'arquivoPatch'. Description does not add extra parameter information beyond what the schema provides, so baseline score of 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?

Description clearly states the action: validate a patch file against the RPO without applying. It distinguishes from sibling tds_patch_apply and specifies the file types (.ptm/.upd/.pak).

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 using this tool before tds_patch_apply ('Gate recomendado antes de tds_patch_apply'). Also clarifies the date semantics, aiding correct usage. Lacks explicit when-not-to-use, 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.

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

A4.2/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=true, and the description aligns by describing a listing operation without mutation. It adds that the result includes source and line, which is useful 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?

The description is a single sentence plus a short usage hint. Every word contributes to understanding, with no redundancy.

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 has 3 optional parameters, no output schema, and clear annotations, the description sufficiently covers the functionality. It does not explain the return format, but that is acceptable without an output schema.

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 the baseline is 3. The description adds an example for the 'filtro' parameter but does not describe 'limite' or 'apenasPublicas' beyond what the schema already provides.

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 RPO functions with source and line, and provides an example of a filter for a specific function. It distinguishes from sibling tools like tds_rpo_info or tds_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 Guidelines4/5

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

The description advises using the filter to search for a specific function with an example. While it does not explicitly state when not to use it or mention alternatives, the context is sufficiently clear for an agent.

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 RPOB
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

B3.4/5.0
Behavior3/5

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

Annotations already indicate readOnlyHint=true, so the description carries a lower burden. It adds context about pre/post-deploy audit but does not disclose additional behavioral traits like side effects or authentication needs.

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 at one sentence, front-loading the key outputs. Every word is necessary, and there is no redundancy.

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 simple read-only tool with one optional parameter and no output schema, the description provides adequate context about what is returned. However, it lacks details on output structure and does not differentiate from similar info tools like tds_patch_info.

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% for the single parameter, so the baseline is 3. The description does not mention the parameter or add any meaning beyond the schema definition.

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 the tool provides RPO version, generation date, and patch history, which defines its purpose. However, it lacks an explicit verb like 'retrieve' or 'get', and while it is distinct from sibling tools like tds_rpo_objects, it could be more precise.

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 guidance is given on when to use this tool versus alternatives such as tds_patch_info or tds_rpo_objects. The description does not mention context, prerequisites, or exclusions.

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 RPOB
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

B3.4/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint: true. The description adds critical behavioral context about the date semantics, which prevents misinterpretation, going beyond what annotations provide.

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 moderately concise. It front-loads the purpose and then provides necessary warnings and usage details. Some sentences could be combined, but it is not overly verbose.

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?

The tool lacks an output schema. The description only mentions 'contagem + primeiros 100' and the dataFonte field, but does not describe the full structure of returned objects. This is a notable gap for a listing 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?

The input schema has 100% coverage with descriptions. The description minimally reinforces parameter usage (e.g., case-insensitive filter) but adds no new semantic information 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 that the tool lists sources/resources from the RPO, and mentions filtering and default behavior. However, it does not explicitly distinguish from siblings like tds_rpo_info or tds_rpo_functions.

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 important guidance on using the dataFonte field correctly and warns against incorrect comparisons. It also explains default behavior without filter. However, it does not mention alternatives or when not to use this tool.

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. Dates show when Glama detected each change.

  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
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
ResponsivenessSyncing

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

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/devCMSS/tds-mcp'

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