Files
manual_slop/scripts/tool_discovery.py
Ed_ 60396f03f8 refactor(types): auto -> None sweep across entire codebase
Applied 236 return type annotations to functions with no return values
across 100+ files (core modules, tests, scripts, simulations).
Added Phase 4 to python_style_refactor track for remaining 597 items
(untyped params, vars, and functions with return values).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:16:56 -05:00

47 lines
1.2 KiB
Python

import json
import sys
import os
# Add project root to sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
try:
import mcp_client
except ImportError as e:
# Print the error to stderr to diagnose
print(f"ImportError in discovery: {e}", file=sys.stderr)
print("[]")
sys.exit(0)
def main() -> None:
specs = list(mcp_client.MCP_TOOL_SPECS)
# Add run_powershell (manually define to match ai_client.py)
specs.append({
"name": "run_powershell",
"description": (
"Run a PowerShell script within the project base_dir. "
"Use this to create, edit, rename, or delete files and directories. "
"The working directory is set to base_dir automatically. "
"stdout and stderr are returned to you as the result."
),
"parameters": {
"type": "object",
"properties": {
"script": {
"type": "string",
"description": "The PowerShell script to execute."
}
},
"required": ["script"]
}
})
# Rename 'parameters' to 'parametersJsonSchema' for Gemini CLI
for spec in specs:
if "parameters" in spec:
spec["parametersJsonSchema"] = spec.pop("parameters")
# Output as JSON array of FunctionDeclarations
print(json.dumps(specs, indent=2))
if __name__ == "__main__":
main()