-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathai-custom-tools-simple.yaml
More file actions
75 lines (68 loc) · 2.17 KB
/
Copy pathai-custom-tools-simple.yaml
File metadata and controls
75 lines (68 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "1.0"
# Example: Using Custom Tools with AI (Reusing ai_mcp_servers)
# This shows the PREFERRED way to expose custom tools - no new config section needed!
# Define custom tools
tools:
grep-pattern:
name: grep-pattern
description: Search for specific patterns in TypeScript files
inputSchema:
type: object
properties:
pattern:
type: string
description: The pattern to search for (regex supported)
required: [pattern]
exec: 'grep -rn "{{ args.pattern }}" *.ts 2>/dev/null || echo "No matches"'
parseJson: false
check-secrets:
name: check-secrets
description: Scan for hardcoded secrets and API keys
inputSchema:
type: object
properties: {}
exec: |
grep -rn -E "(api[_-]?key|secret|password|token)\s*[:=]" . 2>/dev/null | head -10 || echo "No secrets found"
parseJson: false
count-todos:
name: count-todos
description: Count TODO comments in the codebase
inputSchema:
type: object
properties: {}
exec: 'grep -r "TODO" src/ 2>/dev/null | wc -l'
parseJson: false
steps:
# PREFERRED: Use "tools:" in ai_mcp_servers
security-review:
type: ai
prompt: |
You have access to custom security scanning tools.
Use check-secrets to scan for hardcoded credentials.
Use grep-pattern to find dangerous function calls.
# Use ai_custom_tools to reference custom tools defined in this file
ai_custom_tools: [check-secrets, grep-pattern]
ai_mcp_servers:
# You can still combine with external MCP servers
filesystem:
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
ai:
provider: anthropic
model: claude-3-5-sonnet-20241022
debug: true
# ALSO WORKS: Legacy ai_custom_tools format (for backward compatibility)
code-quality:
type: ai
prompt: |
Use count-todos to analyze pending work items.
ai_custom_tools: [count-todos] # ← Also works, but ai_mcp_servers is preferred
ai:
provider: anthropic
model: claude-3-5-sonnet-20241022
output:
pr_comment:
enabled: true
format: markdown
group_by: check
collapse: false