Draft
Conversation
Adds a new read tool backed by GET /v2.1/public/contracts/{contract_id}/process_metrics/.
Motivation: the sidebar agent entered a 73+ sub-call retry loop when asked
for signing timelines on 10 contracts (trace 019bbb80, nykaa/vivek.jha).
No existing MCP tool exposed signing timestamps; the agent repeatedly tried
get_contract_activity_log (which only returns user comments) and
get_contract_status (which returns no timestamps).
The new tool surfaces:
- marked_for_signature_datetime (signing initiated)
- contract_executed_datetime (all parties signed)
- contract_sent_to_cp_datetime (sent to counterparty)
- contract_signed_by_signatory_list (per-signatory timestamps)
- contract_turns.no_of_turns (negotiation turn count)
- pending_with (who currently holds the ball)
The tool description explicitly redirects agents away from
get_contract_activity_log for timeline queries and documents the
integer-only ID requirement (no T-/H- prefix).
Also updates AGENTS.md to clarify that get_contract_activity_log returns
user comments only, not workflow events.
Co-authored-by: Jaskaran Bhatia <jaskaran@spotdraft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Adds a new read tool
get_contract_process_metricsbacked byGET /v2.1/public/contracts/{contract_id}/process_metrics/.Motivation
The sidebar agent entered a 73+ sub-call retry loop when asked for signing timelines on 10 contracts. No existing MCP tool exposed signing timestamps — the agent repeatedly tried
get_contract_activity_log(which only returns user-written comments) andget_contract_status(which returns no timestamps at all), spending 3 min 25 sec on a single reply.This tool fills that data gap.
New tool:
get_contract_process_metricsmarked_for_signature_datetimecontract_executed_datetimecontract_sent_to_cp_datetimecp_opened_review_email_datetimecontract_signed_by_signatory_listcontract_turns.no_of_turnspending_withThe tool description explicitly steers agents away from
get_contract_activity_logfor timeline queries and documents the integer-only ID requirement (noT-/H-prefix).Also changed
src/tools/contracts/AGENTS.md: clarifiesget_contract_activity_logreturns user comments only (not workflow events), and addsget_contract_process_metricsto the public surface table.CHANGELOG.md: documents the addition under[Unreleased].Files changed
src/tools/contracts/get_contract_process_metrics.ts← new toolsrc/tools/index.ts← registrationsrc/tools/contracts/AGENTS.md← updatedCHANGELOG.md← updatedValidation
npm run buildpasses cleanly (TypeScript + chmod step)build/tools/contracts/get_contract_process_metrics.jsbuild/tools/index.jsGenerated description
Below is a concise technical summary of the changes proposed in this PR:
Add
get_contract_process_metricsread tool that fetches workflow timeline timestamps and process measurements via the SpotDraft client for any contract. Document and expose the tool in guidance materials, steering agents away fromget_contract_activity_logwhen they need signing and execution timelines.get_contract_activity_logonly surfaces user comments, add the new tool to the public surface, and record the change in the changelog.Modified files (2)
Latest Contributors(2)
get_contract_process_metricstool and register it so agents can fetch contract timeline timestamps and process metrics through the SpotDraft client.Modified files (2)
Latest Contributors(2)