@andre.buzeli/git-mcp 16.0.8 → 16.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,284 +1,322 @@
1
- import { asToolResult } from "../utils/errors.js";
2
-
3
- /**
4
- * Tool de ajuda para AI Agents - fornece orientação sobre qual tool usar
5
- */
6
- export function createGitHelpTool() {
7
- const inputSchema = {
8
- type: "object",
9
- properties: {
10
- query: {
11
- type: "string",
12
- description: "O que você quer fazer? Ex: 'criar repositório', 'fazer commit', 'criar branch'"
13
- },
14
- listTools: {
15
- type: "boolean",
16
- description: "Se true, lista todas as tools disponíveis com descrição resumida"
17
- },
18
- showFlows: {
19
- type: "boolean",
20
- description: "Se true, mostra fluxos de trabalho comuns"
21
- }
22
- },
23
- additionalProperties: false
24
- };
25
-
26
- const TOOLS_SUMMARY = {
27
- "git-workflow": {
28
- purpose: "Operações básicas do dia-a-dia: init, status, add, commit, push, update (⭐ RECOMENDADO)",
29
- actions: ["init", "status", "add", "remove", "commit", "push", "ensure-remotes", "clean", "update"],
30
- useWhen: "Salvar e enviar mudanças. Use action='update' para fluxo automatizado completo (status → add → commit → push)"
31
- },
32
- "git-branches": {
33
- purpose: "Gerenciar branches: criar, listar, trocar, deletar",
34
- actions: ["list", "create", "checkout", "delete", "rename"],
35
- useWhen: "Trabalhar em features isoladas, organizar desenvolvimento"
36
- },
37
- "git-merge": {
38
- purpose: "Juntar branches após desenvolvimento",
39
- actions: ["merge", "abort", "status"],
40
- useWhen: "Integrar feature branch na main/develop"
41
- },
42
- "git-stash": {
43
- purpose: "Salvar mudanças temporariamente sem commit",
44
- actions: ["list", "save", "apply", "pop", "drop", "clear"],
45
- useWhen: "Trocar de branch com mudanças não commitadas"
46
- },
47
- "git-tags": {
48
- purpose: "Marcar versões/releases",
49
- actions: ["list", "create", "delete", "push"],
50
- useWhen: "Publicar versão (v1.0.0, v2.0.0)"
51
- },
52
- "git-history": {
53
- purpose: "Ver histórico de commits",
54
- actions: ["log"],
55
- useWhen: "Encontrar commit específico, ver quem alterou o quê"
56
- },
57
- "git-diff": {
58
- purpose: "Ver diferenças entre versões",
59
- actions: ["show", "compare", "stat"],
60
- useWhen: "Revisar mudanças antes de commit, comparar branches"
61
- },
62
- "git-reset": {
63
- purpose: "Desfazer commits ou mudanças",
64
- actions: ["soft", "mixed", "hard", "hard-clean"],
65
- useWhen: "Desfazer último commit, limpar working directory"
66
- },
67
- "git-config": {
68
- purpose: "Configurar Git (nome, email, etc)",
69
- actions: ["get", "set", "unset", "list"],
70
- useWhen: "Configurar autor dos commits"
71
- },
72
- "git-remote": {
73
- purpose: "Operações em GitHub/Gitea",
74
- actions: ["list", "ensure", "release-create", "topics-set", "label-create"],
75
- useWhen: "Criar release, configurar repositório remoto"
76
- },
77
- "git-sync": {
78
- purpose: "Sincronizar com remotes",
79
- actions: ["fetch", "pull"],
80
- useWhen: "Baixar mudanças de outros desenvolvedores"
81
- },
82
- "git-clone": {
83
- purpose: "Clonar repositório existente",
84
- actions: ["clone"],
85
- useWhen: "Baixar projeto existente do GitHub/Gitea"
86
- },
87
- "git-ignore": {
88
- purpose: "Gerenciar .gitignore",
89
- actions: ["list", "create", "add", "remove"],
90
- useWhen: "Ignorar arquivos (node_modules, .env, etc)"
91
- },
92
- "git-files": {
93
- purpose: "Ler arquivos do histórico Git",
94
- actions: ["list", "read"],
95
- useWhen: "Ver arquivo em versão antiga"
96
- },
97
- "git-issues": {
98
- purpose: "Gerenciar issues no GitHub/Gitea",
99
- actions: ["create", "list", "comment"],
100
- useWhen: "Reportar bugs, criar tarefas"
101
- },
102
- "git-pulls": {
103
- purpose: "Gerenciar Pull Requests",
104
- actions: ["create", "list", "files"],
105
- useWhen: "Propor mudanças para review"
106
- }
107
- };
108
-
109
- const COMMON_FLOWS = {
110
- "novo-projeto": {
111
- description: "Criar repositório do zero",
112
- steps: [
113
- { tool: "git-workflow", action: "init", note: "Inicializa git e cria repos no GitHub/Gitea" },
114
- { tool: "git-workflow", action: "add", params: { files: ["."] } },
115
- { tool: "git-workflow", action: "commit", params: { message: "Initial commit" } },
116
- { tool: "git-workflow", action: "push" }
117
- ]
118
- },
119
- "salvar-mudancas": {
120
- description: "Salvar e enviar mudanças (fluxo automatizado)",
121
- steps: [
122
- { tool: "git-workflow", action: "update", params: { message: "sua mensagem" }, note: "⭐ Executa status, add, commit e push automaticamente" }
123
- ]
124
- },
125
- "nova-feature": {
126
- description: "Desenvolver feature em branch separada",
127
- steps: [
128
- { tool: "git-branches", action: "create", params: { branch: "feature/nome" } },
129
- { tool: "git-branches", action: "checkout", params: { branch: "feature/nome" } },
130
- { note: "... fazer mudanças ..." },
131
- { tool: "git-workflow", action: "add" },
132
- { tool: "git-workflow", action: "commit" },
133
- { tool: "git-branches", action: "checkout", params: { branch: "main" } },
134
- { tool: "git-merge", action: "merge", params: { branch: "feature/nome" } },
135
- { tool: "git-workflow", action: "push" }
136
- ]
137
- },
138
- "criar-release": {
139
- description: "Publicar nova versão",
140
- steps: [
141
- { tool: "git-tags", action: "create", params: { tag: "v1.0.0", message: "Release v1.0.0" } },
142
- { tool: "git-tags", action: "push", params: { tag: "v1.0.0" } },
143
- { tool: "git-remote", action: "release-create", params: { tag: "v1.0.0", name: "v1.0.0" } }
144
- ]
145
- },
146
- "desfazer-commit": {
147
- description: "Desfazer último commit mantendo mudanças",
148
- steps: [
149
- { tool: "git-reset", action: "soft", params: { ref: "HEAD~1" } }
150
- ]
151
- },
152
- "trocar-branch-com-mudancas": {
153
- description: "Salvar mudanças e trocar de branch",
154
- steps: [
155
- { tool: "git-stash", action: "save", params: { message: "WIP" } },
156
- { tool: "git-branches", action: "checkout", params: { branch: "outra-branch" } },
157
- { note: "... fazer o que precisar ..." },
158
- { tool: "git-branches", action: "checkout", params: { branch: "branch-original" } },
159
- { tool: "git-stash", action: "pop" }
160
- ]
161
- }
162
- };
163
-
164
- // Mapeamento de intenções para tools
165
- const INTENT_MAP = {
166
- // Palavras-chave -> tool recomendada
167
- "criar reposit": "git-workflow (action=init)",
168
- "iniciar projeto": "git-workflow (action=init)",
169
- "novo projeto": "git-workflow (action=init)",
170
- "commit": "git-workflow (action=commit)",
171
- "salvar": "git-workflow (action=update) - fluxo completo automatizado",
172
- "atualizar": "git-workflow (action=update) - fluxo completo automatizado",
173
- "update": "git-workflow (action=update) - ⭐ fluxo completo automatizado",
174
- "push": "git-workflow (action=push)",
175
- "enviar": "git-workflow (action=push)",
176
- "branch": "git-branches",
177
- "criar branch": "git-branches (action=create)",
178
- "trocar branch": "git-branches (action=checkout)",
179
- "merge": "git-merge",
180
- "juntar": "git-merge",
181
- "stash": "git-stash",
182
- "guardar": "git-stash (action=save)",
183
- "tag": "git-tags",
184
- "versão": "git-tags",
185
- "release": "git-remote (action=release-create)",
186
- "histórico": "git-history",
187
- "log": "git-history",
188
- "diff": "git-diff",
189
- "diferença": "git-diff",
190
- "desfazer": "git-reset",
191
- "reset": "git-reset",
192
- "clone": "git-clone",
193
- "clonar": "git-clone",
194
- "baixar projeto": "git-clone",
195
- "issue": "git-issues",
196
- "bug": "git-issues (action=create)",
197
- "pull request": "git-pulls",
198
- "pr": "git-pulls",
199
- "ignorar": "git-ignore",
200
- "gitignore": "git-ignore",
201
- "config": "git-config",
202
- "configurar": "git-config",
203
- "status": "git-workflow (action=status)",
204
- "ver mudanças": "git-workflow (action=status)"
205
- };
206
-
207
- const description = `Ajuda para AI Agents - descobre qual tool usar para cada situação.
208
-
209
- USE ESTA TOOL QUANDO:
210
- - Não sabe qual git-* tool usar
211
- - Precisa ver fluxos de trabalho comuns
212
- - Quer lista de todas as tools disponíveis
213
-
214
- EXEMPLOS:
215
- • { "query": "como criar um repositório?" }
216
- • { "listTools": true }
217
- • { "showFlows": true }`;
218
-
219
- async function handle(args) {
220
- const { query, listTools, showFlows } = args || {};
221
-
222
- // Listar todas as tools
223
- if (listTools) {
224
- return asToolResult({
225
- tools: TOOLS_SUMMARY,
226
- tip: "Use query='o que você quer fazer' para recomendação específica"
227
- });
228
- }
229
-
230
- // Mostrar fluxos comuns
231
- if (showFlows) {
232
- return asToolResult({
233
- flows: COMMON_FLOWS,
234
- tip: "Siga os steps em ordem para cada fluxo"
235
- });
236
- }
237
-
238
- // Buscar por query
239
- if (query) {
240
- const q = query.toLowerCase();
241
- const matches = [];
242
-
243
- for (const [intent, tool] of Object.entries(INTENT_MAP)) {
244
- if (q.includes(intent) || intent.includes(q)) {
245
- matches.push({ intent, recommendation: tool });
246
- }
247
- }
248
-
249
- if (matches.length > 0) {
250
- return asToolResult({
251
- query,
252
- recommendations: matches,
253
- tip: "Use a tool recomendada com os parâmetros indicados"
254
- });
255
- }
256
-
257
- return asToolResult({
258
- query,
259
- message: "Não encontrei recomendação específica. Veja todas as tools:",
260
- tools: Object.keys(TOOLS_SUMMARY),
261
- tip: "Use listTools=true para ver detalhes de cada tool"
262
- });
263
- }
264
-
265
- // Sem parâmetros - retornar overview
266
- return asToolResult({
267
- message: "Git MCP - Tools para AI Agents",
268
- availableTools: Object.keys(TOOLS_SUMMARY).length,
269
- usage: {
270
- "Recomendação": "{ query: 'o que você quer fazer' }",
271
- "Listar tools": "{ listTools: true }",
272
- "Ver fluxos": "{ showFlows: true }"
273
- },
274
- quickStart: "Para começar um projeto: git-workflow com action='init'"
275
- });
276
- }
277
-
278
- return {
279
- name: "git-help",
280
- description,
281
- inputSchema,
282
- handle
283
- };
284
- }
1
+ import { asToolResult } from "../utils/errors.js";
2
+
3
+ /**
4
+ * Tool de ajuda para AI Agents - fornece orientação sobre qual tool usar
5
+ */
6
+ export function createGitHelpTool() {
7
+ const inputSchema = {
8
+ type: "object",
9
+ properties: {
10
+ query: {
11
+ type: "string",
12
+ description: "O que você quer fazer? Ex: 'criar repositório', 'fazer commit', 'criar branch'"
13
+ },
14
+ listTools: {
15
+ type: "boolean",
16
+ description: "Se true, lista todas as tools disponíveis com descrição resumida"
17
+ },
18
+ showFlows: {
19
+ type: "boolean",
20
+ description: "Se true, mostra fluxos de trabalho comuns"
21
+ }
22
+ },
23
+ additionalProperties: false
24
+ };
25
+
26
+ const TOOLS_SUMMARY = {
27
+ "git-workflow": {
28
+ purpose: "Operações básicas do dia-a-dia: init, status, add, commit, push, update (⭐ RECOMENDADO)",
29
+ actions: ["init", "status", "add", "remove", "commit", "push", "ensure-remotes", "clean", "update"],
30
+ useWhen: "Salvar e enviar mudanças. Use action='update' para fluxo completo automatizado (status → add → commit → push)"
31
+ },
32
+ "git-worktree": {
33
+ purpose: "Gerenciar worktrees (multibranch)",
34
+ actions: ["add", "list", "remove", "setup", "set-channel"],
35
+ useWhen: "Trabalhar em múltiplas branches/plataformas simultaneamente no mesmo repo"
36
+ },
37
+ "git-branches": {
38
+ purpose: "Gerenciar branches: criar, listar, trocar, deletar",
39
+ actions: ["list", "create", "checkout", "delete", "rename"],
40
+ useWhen: "Trabalhar em features isoladas, organizar desenvolvimento"
41
+ },
42
+ "git-merge": {
43
+ purpose: "Juntar branches após desenvolvimento",
44
+ actions: ["merge", "abort", "status"],
45
+ useWhen: "Integrar feature branch na main/develop"
46
+ },
47
+ "git-stash": {
48
+ purpose: "Salvar mudanças temporariamente sem commit",
49
+ actions: ["list", "save", "apply", "pop", "drop", "clear"],
50
+ useWhen: "Trocar de branch com mudanças não commitadas"
51
+ },
52
+ "git-tags": {
53
+ purpose: "Marcar versões/releases",
54
+ actions: ["list", "create", "delete", "push"],
55
+ useWhen: "Publicar versão (v1.0.0, v2.0.0)"
56
+ },
57
+ "git-history": {
58
+ purpose: "Ver histórico de commits",
59
+ actions: ["log"],
60
+ useWhen: "Encontrar commit específico, ver quem alterou o quê"
61
+ },
62
+ "git-diff": {
63
+ purpose: "Ver diferenças entre versões",
64
+ actions: ["show", "compare", "stat"],
65
+ useWhen: "Revisar mudanças antes de commit, comparar branches"
66
+ },
67
+ "git-reset": {
68
+ purpose: "Desfazer commits ou mudanças",
69
+ actions: ["soft", "mixed", "hard", "hard-clean"],
70
+ useWhen: "Desfazer último commit, limpar working directory"
71
+ },
72
+ "git-config": {
73
+ purpose: "Configurar Git (nome, email, etc)",
74
+ actions: ["get", "set", "unset", "list"],
75
+ useWhen: "Configurar autor dos commits"
76
+ },
77
+ "git-remote": {
78
+ purpose: "Operações em GitHub/Gitea",
79
+ actions: ["list", "ensure", "release-create", "topics-set", "label-create"],
80
+ useWhen: "Criar release, configurar repositório remoto"
81
+ },
82
+ "git-sync": {
83
+ purpose: "Sincronizar com remotes",
84
+ actions: ["fetch", "pull"],
85
+ useWhen: "Baixar mudanças de outros desenvolvedores"
86
+ },
87
+ "git-clone": {
88
+ purpose: "Clonar repositório existente",
89
+ actions: ["clone"],
90
+ useWhen: "Baixar projeto existente do GitHub/Gitea"
91
+ },
92
+ "git-ignore": {
93
+ purpose: "Gerenciar .gitignore",
94
+ actions: ["list", "create", "add", "remove"],
95
+ useWhen: "Ignorar arquivos (node_modules, .env, etc)"
96
+ },
97
+ "git-files": {
98
+ purpose: "Ler arquivos do histórico Git",
99
+ actions: ["list", "read"],
100
+ useWhen: "Ver arquivo em versão antiga"
101
+ },
102
+ "git-issues": {
103
+ purpose: "Gerenciar issues no GitHub/Gitea",
104
+ actions: ["create", "list", "comment"],
105
+ useWhen: "Reportar bugs, criar tarefas"
106
+ },
107
+ "git-pulls": {
108
+ purpose: "Gerenciar Pull Requests",
109
+ actions: ["create", "list", "files"],
110
+ useWhen: "Propor mudanças para review"
111
+ }
112
+ };
113
+
114
+ const COMMON_FLOWS = {
115
+ "novo-projeto": {
116
+ description: "Criar repositório do zero",
117
+ steps: [
118
+ { tool: "git-workflow", action: "init", note: "Inicializa git e cria repos no GitHub/Gitea" },
119
+ { tool: "git-workflow", action: "add", params: { files: ["."] } },
120
+ { tool: "git-workflow", action: "commit", params: { message: "Initial commit" } },
121
+ { tool: "git-workflow", action: "push" }
122
+ ]
123
+ },
124
+ "salvar-mudancas": {
125
+ description: "Salvar e enviar mudanças (fluxo automatizado)",
126
+ steps: [
127
+ { tool: "git-workflow", action: "update", params: { message: "sua mensagem" }, note: "⭐ Executa status, add, commit e push automaticamente" }
128
+ ]
129
+ },
130
+ "nova-feature": {
131
+ description: "Desenvolver feature em branch separada",
132
+ steps: [
133
+ { tool: "git-branches", action: "create", params: { branch: "feature/nome" } },
134
+ { tool: "git-branches", action: "checkout", params: { branch: "feature/nome" } },
135
+ { note: "... fazer mudanças ..." },
136
+ { tool: "git-workflow", action: "add" },
137
+ { tool: "git-workflow", action: "commit" },
138
+ { tool: "git-branches", action: "checkout", params: { branch: "main" } },
139
+ { tool: "git-merge", action: "merge", params: { branch: "feature/nome" } },
140
+ { tool: "git-workflow", action: "push" }
141
+ ]
142
+ },
143
+ "criar-release": {
144
+ description: "Publicar nova versão",
145
+ steps: [
146
+ { tool: "git-tags", action: "create", params: { tag: "v1.0.0", message: "Release v1.0.0" } },
147
+ { tool: "git-tags", action: "push", params: { tag: "v1.0.0" } },
148
+ { tool: "git-remote", action: "release-create", params: { tag: "v1.0.0", name: "v1.0.0" } }
149
+ ]
150
+ },
151
+ "desfazer-commit": {
152
+ description: "Desfazer último commit mantendo mudanças",
153
+ steps: [
154
+ { tool: "git-reset", action: "soft", params: { ref: "HEAD~1" } }
155
+ ]
156
+ },
157
+ "trocar-branch-com-mudancas": {
158
+ description: "Salvar mudanças e trocar de branch",
159
+ steps: [
160
+ { tool: "git-stash", action: "save", params: { message: "WIP" } },
161
+ { tool: "git-branches", action: "checkout", params: { branch: "outra-branch" } },
162
+ { note: "... fazer o que precisar ..." },
163
+ { tool: "git-branches", action: "checkout", params: { branch: "branch-original" } },
164
+ { tool: "git-stash", action: "pop" }
165
+ ]
166
+ },
167
+ "multibranch-worktree": {
168
+ description: "Setup de ambiente multi-plataforma com worktrees",
169
+ steps: [
170
+ { tool: "git-worktree", action: "add", params: { branch: "mac", channel: "beta" } },
171
+ { tool: "git-worktree", action: "add", params: { branch: "win", channel: "production" } },
172
+ { tool: "git-workflow", action: "update", params: { message: "sync all", syncBranches: true }, note: "Propaga mudanças do principal para todos os worktrees" }
173
+ ]
174
+ }
175
+ };
176
+
177
+ const PROJECT_PATH_GUIDANCE = {
178
+ description: "Como obter o projectPath correto",
179
+ rule: "Use sempre o caminho absoluto do projeto sendo trabalhado no IDE",
180
+ howToFind: [
181
+ "No terminal do projeto: execute 'pwd' (Linux/Mac) ou 'cd' (Windows)",
182
+ "No IDE: copie o path mostrado na barra de título ou no explorador de arquivos",
183
+ "Exemplo Linux/Mac: '/home/usuario/meu-projeto'",
184
+ "Exemplo Windows: 'C:/Users/usuario/meu-projeto'"
185
+ ],
186
+ commonMistakes: [
187
+ "NÃO use o diretório home do usuário (ex: '/home/usuario' ou 'C:/Users/usuario')",
188
+ "NÃO use caminhos relativos (ex: './projeto' ou '../projeto')",
189
+ "NÃO omita o parâmetro — o servidor não consegue inferir o path automaticamente"
190
+ ]
191
+ };
192
+
193
+ // Mapeamento de intenções para tools
194
+ const INTENT_MAP = {
195
+ // Palavras-chave -> tool recomendada
196
+ "criar reposit": "git-workflow (action=init)",
197
+ "iniciar projeto": "git-workflow (action=init)",
198
+ "novo projeto": "git-workflow (action=init)",
199
+ "commit": "git-workflow (action=commit)",
200
+ "salvar": "git-workflow (action=update) - ⭐ fluxo completo automatizado",
201
+ "atualizar": "git-workflow (action=update) - ⭐ fluxo completo automatizado",
202
+ "update": "git-workflow (action=update) - ⭐ fluxo completo automatizado",
203
+ "push": "git-workflow (action=push)",
204
+ "enviar": "git-workflow (action=push)",
205
+ "branch": "git-branches",
206
+ "criar branch": "git-branches (action=create)",
207
+ "trocar branch": "git-branches (action=checkout)",
208
+ "merge": "git-merge",
209
+ "juntar": "git-merge",
210
+ "stash": "git-stash",
211
+ "guardar": "git-stash (action=save)",
212
+ "tag": "git-tags",
213
+ "versão": "git-tags",
214
+ "release": "git-remote (action=release-create)",
215
+ "histórico": "git-history",
216
+ "log": "git-history",
217
+ "diff": "git-diff",
218
+ "diferença": "git-diff",
219
+ "desfazer": "git-reset",
220
+ "reset": "git-reset",
221
+ "clone": "git-clone",
222
+ "clonar": "git-clone",
223
+ "baixar projeto": "git-clone",
224
+ "issue": "git-issues",
225
+ "bug": "git-issues (action=create)",
226
+ "pull request": "git-pulls",
227
+ "pr": "git-pulls",
228
+ "ignorar": "git-ignore",
229
+ "gitignore": "git-ignore",
230
+ "config": "git-config",
231
+ "configurar": "git-config",
232
+ "status": "git-workflow (action=status)",
233
+ "ver mudanças": "git-workflow (action=status)",
234
+ "worktree": "git-worktree",
235
+ "canal": "git-worktree (action=set-channel)",
236
+ "channel": "git-worktree (action=set-channel)",
237
+ "plataforma": "git-worktree (action=add)",
238
+ "sync branches": "git-workflow (action=update, syncBranches=true)",
239
+ "multibranch": "git-worktree"
240
+ };
241
+
242
+ const description = `Ajuda para AI Agents - descobre qual tool usar para cada situação.
243
+
244
+ USE ESTA TOOL QUANDO:
245
+ - Não sabe qual git-* tool usar
246
+ - Precisa ver fluxos de trabalho comuns
247
+ - Quer lista de todas as tools disponíveis
248
+
249
+ EXEMPLOS:
250
+ { "query": "como criar um repositório?" }
251
+ • { "listTools": true }
252
+ • { "showFlows": true }`;
253
+
254
+ async function handle(args) {
255
+ const { query, listTools, showFlows } = args || {};
256
+
257
+ // Listar todas as tools
258
+ if (listTools) {
259
+ return asToolResult({
260
+ tools: TOOLS_SUMMARY,
261
+ projectPathGuidance: PROJECT_PATH_GUIDANCE,
262
+ tip: "Use query='o que você quer fazer' para recomendação específica"
263
+ });
264
+ }
265
+
266
+ // Mostrar fluxos comuns
267
+ if (showFlows) {
268
+ return asToolResult({
269
+ flows: COMMON_FLOWS,
270
+ tip: "Siga os steps em ordem para cada fluxo"
271
+ });
272
+ }
273
+
274
+ // Buscar por query
275
+ if (query) {
276
+ const q = query.toLowerCase();
277
+ const matches = [];
278
+
279
+ for (const [intent, tool] of Object.entries(INTENT_MAP)) {
280
+ if (q.includes(intent) || intent.includes(q)) {
281
+ matches.push({ intent, recommendation: tool });
282
+ }
283
+ }
284
+
285
+ if (matches.length > 0) {
286
+ return asToolResult({
287
+ query,
288
+ recommendations: matches,
289
+ tip: "Use a tool recomendada com os parâmetros indicados"
290
+ });
291
+ }
292
+
293
+ return asToolResult({
294
+ query,
295
+ message: "Não encontrei recomendação específica. Veja todas as tools:",
296
+ tools: Object.keys(TOOLS_SUMMARY),
297
+ tip: "Use listTools=true para ver detalhes de cada tool"
298
+ });
299
+ }
300
+
301
+ // Sem parâmetros - retornar overview
302
+ return asToolResult({
303
+ message: "Git MCP - Tools para AI Agents",
304
+ availableTools: Object.keys(TOOLS_SUMMARY).length,
305
+ projectPathGuidance: PROJECT_PATH_GUIDANCE,
306
+ usage: {
307
+ "Recomendação": "{ query: 'o que você quer fazer' }",
308
+ "Listar tools": "{ listTools: true }",
309
+ "Ver fluxos": "{ showFlows: true }"
310
+ },
311
+ quickStart: "Para começar um projeto: git-workflow com action='init'"
312
+ });
313
+ }
314
+
315
+ return {
316
+ name: "git-help",
317
+ description,
318
+ inputSchema,
319
+ handle,
320
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
321
+ };
322
+ }