MCPcopy Create free account
hub / github.com/github/gh-aw / buildMissingToolContext

Function buildMissingToolContext

actions/setup/js/handle_agent_failure.cjs:1318–1334  ·  view source on GitHub ↗

* Build missing_tool context string for display in failure issues/comments. * @param {Array } [items] - Optional pre-loaded agent output items. When provided, avoids re-reading the output file. * @returns {string} Formatted missing tool context

(items)

Source from the content-addressed store, hash-verified

1316 * @returns {string} Formatted missing tool context
1317 */
1318function buildMissingToolContext(items) {
1319 const missingToolMessages = loadMissingToolMessages(items).filter(message => !isPermissionDeniedMissingTool(message));
1320
1321 if (missingToolMessages.length === 0) {
1322 return "";
1323 }
1324
1325 core.info(`Found ${missingToolMessages.length} missing_tool message(s)`);
1326
1327 const formattedList = formatMissingTools(missingToolMessages);
1328
1329 let context = buildWarningAlertLine("Missing Tools Reported", "The agent reported missing tools during execution.") + "\n**Missing Tools:**\n";
1330 context += formattedList;
1331 context += "\n\n";
1332
1333 return context;
1334}
1335
1336/**
1337 * Build permission denied context string when the agent reported numerous permission denied errors.

Callers 2

mainFunction · 0.85

Calls 4

loadMissingToolMessagesFunction · 0.85
formatMissingToolsFunction · 0.85
buildWarningAlertLineFunction · 0.85

Tested by

no test coverage detected