MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / buildEffectiveNextStepParams

Function buildEffectiveNextStepParams

src/runtime/tool-invoker.ts:189–211  ·  view source on GitHub ↗
(
  nextStepParams: NextStepParamsMap | undefined,
  handlerNextSteps: NextStep[] | undefined,
  catalog: ToolCatalog,
)

Source from the content-addressed store, hash-verified

187}
188
189function buildEffectiveNextStepParams(
190 nextStepParams: NextStepParamsMap | undefined,
191 handlerNextSteps: NextStep[] | undefined,
192 catalog: ToolCatalog,
193): NextStepParamsMap | undefined {
194 if (!handlerNextSteps || handlerNextSteps.length === 0) {
195 return nextStepParams;
196 }
197
198 let merged: NextStepParamsMap | undefined = nextStepParams;
199 for (const step of handlerNextSteps) {
200 if (!step.tool || !step.params || Object.keys(step.params).length === 0) {
201 continue;
202 }
203 const target = catalog.getByMcpName(step.tool);
204 const toolId = target?.id ?? step.tool;
205 if (merged?.[toolId]) {
206 continue;
207 }
208 merged = { ...merged, [toolId]: step.params as NextStepParams };
209 }
210 return merged;
211}
212
213export function postProcessSession(params: {
214 tool: ToolDefinition;

Callers 1

postProcessSessionFunction · 0.85

Calls 1

getByMcpNameMethod · 0.80

Tested by

no test coverage detected