Skip to content

feat(agentforge): parse Google-style docstring Args for tool parameter descriptions#56

Draft
ChunkyTortoise wants to merge 2 commits into
mainfrom
spec-to-pr/agentforge-docstring-params
Draft

feat(agentforge): parse Google-style docstring Args for tool parameter descriptions#56
ChunkyTortoise wants to merge 2 commits into
mainfrom
spec-to-pr/agentforge-docstring-params

Conversation

@ChunkyTortoise

Copy link
Copy Markdown
Owner

Summary

  • Implements the long-standing TODO in agentforge/agentforge/tools/base.py BaseTool._generate_schema so each tool's execute docstring populates the JSON-schema description for its parameters.
  • Adds a _parse_docstring_args helper that handles the Google-style Args section, including multi-line descriptions and the optional name (type) form.
  • Adds 4 unit tests in agentforge/tests/test_tools.py.

Diff stat

2 files changed, 179 insertions, 2 deletions.

Notes

  • Branch was preserved during the 2026-05-22 git hygiene pass with a written FINISH recommendation at .maintenance/eh-worktree-decision.md.
  • An untracked agentforge/uv.lock lives next to the work; intentionally NOT included in this PR (separate decision).

Test plan

  • CI green
  • Manual: instantiate a tool with a Google-style docstring; confirm parameter descriptions appear in tool.schema

Draft pending final read.

chunktort and others added 2 commits May 19, 2026 22:28
Drift fixes:
- README: replace broken services/llm_observability.py link with honest
  reference to A/B testing + per-bot cost tracker (file does not exist;
  end-to-end OTel tracing is planned, not shipped)
- README: fix ghl_real_estate_ai/app.py link, point to api/main.py
- README: drop llm_observability.py from project-structure tree
- README + HIRING_REVIEW_GUIDE + CLAIM_LEDGER: update test count from
  7,721 (Apr 29) to 7,665 (May 19) per fresh pytest --collect-only
- docs/OBSERVABILITY.md: mark LLM Call Tracing and Agent Cost Tracker
  sections as Planned; both reference services that do not exist
Implement the TODO in BaseTool._generate_schema so that a tool's
execute docstring populates each parameter's schema description.
Adds a _parse_docstring_args helper that extracts the Google-style
Args section, supporting multi-line descriptions and the optional
name (type) form. Tools without a docstring, without an Args
section, or with undocumented parameters produce an unchanged
schema. Adds four unit tests covering these cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants