@@ -239,10 +239,9 @@ func (r *MCPReader) Dossier(ctx context.Context, in mcpcontract.RepoInput) (mcpc
239239 return mcpcontract.DossierOutput {}, mcpcontract .Unavailable (
240240 "repository_not_indexed" ,
241241 fmt .Sprintf ("Repository %s is not present in the local corpus." , ref ),
242- mcpcontract.SuggestedAction {
243- Tool : mcpcontract .ToolSyncRepositoryContext ,
244- Reason : "Persist repository metadata before requesting local derived artifacts." ,
245- Arguments : & mcpcontract.SuggestedActionArguments {
242+ mcpcontract.ToolCall {
243+ Tool : mcpcontract .ToolSyncRepositoryContext ,
244+ Arguments : & mcpcontract.ToolCallArguments {
246245 Repositories : []mcpcontract.RepositoryRef {{Owner : ref .Owner , Repo : ref .Repo }},
247246 },
248247 },
@@ -256,10 +255,9 @@ func (r *MCPReader) Dossier(ctx context.Context, in mcpcontract.RepoInput) (mcpc
256255 return mcpcontract.DossierOutput {}, mcpcontract .Unavailable (
257256 "dossier_not_persisted" ,
258257 fmt .Sprintf ("No persisted dossier exists for %s." , ref ),
259- mcpcontract.SuggestedAction {
260- Tool : mcpcontract .ToolGetRepositories ,
261- Reason : "Read available repository metadata without creating local state." ,
262- Arguments : & mcpcontract.SuggestedActionArguments {
258+ mcpcontract.ToolCall {
259+ Tool : mcpcontract .ToolGetRepositories ,
260+ Arguments : & mcpcontract.ToolCallArguments {
263261 Repositories : []mcpcontract.RepositoryRef {{Owner : ref .Owner , Repo : ref .Repo }},
264262 },
265263 },
@@ -622,11 +620,14 @@ func (r *MCPReader) GetCoverage(ctx context.Context, in mcpcontract.GetCoverageI
622620 out .Status = "partial"
623621 } else if reason != "" {
624622 item .Status , item .Reason = "unavailable" , reason
625- if reason == "not_indexed" {
623+ item .Message = "owner/repo and optional kind/number must identify a repository or exact thread"
624+ switch reason {
625+ case "repository_not_indexed" :
626+ item .Message = "target is not present in the local corpus"
627+ item .Recovery = recoveryPlan (reason , item .Message , syncRepositoryContextCall (target .Owner , target .Repo ))
628+ case "thread_not_indexed" :
626629 item .Message = "target is not present in the local corpus"
627- item .NextAction = "Synchronize the repository or thread explicitly, then retry this item."
628- } else {
629- item .Message = "owner/repo and optional kind/number must identify a repository or exact thread"
630+ item .Recovery = recoveryPlan (reason , item .Message , syncThreadCall (mcpcontract .ThreadRef (target )))
630631 }
631632 out .Status = "partial"
632633 } else {
@@ -661,7 +662,7 @@ func readCoverageTarget(ctx context.Context, c *corpus.Corpus, target mcpcontrac
661662 return mcpcontract.CoverageOutput {}, "" , fmt .Errorf ("get repository: %w" , err )
662663 }
663664 if repo == nil {
664- return mcpcontract.CoverageOutput {}, "not_indexed " , nil
665+ return mcpcontract.CoverageOutput {}, "repository_not_indexed " , nil
665666 }
666667 var threadID * int64
667668 asOf := repo .SourceUpdatedAt
@@ -671,7 +672,7 @@ func readCoverageTarget(ctx context.Context, c *corpus.Corpus, target mcpcontrac
671672 return mcpcontract.CoverageOutput {}, "" , fmt .Errorf ("get thread: %w" , err )
672673 }
673674 if thread == nil {
674- return mcpcontract.CoverageOutput {}, "not_indexed " , nil
675+ return mcpcontract.CoverageOutput {}, "thread_not_indexed " , nil
675676 }
676677 threadID = & thread .ID
677678 asOf = thread .SourceUpdatedAt
0 commit comments