Function: response()
ts
function response(data): ResponseBuilder;Defined in: packages/core/src/presenter/ResponseBuilder.ts:389
Create a new response builder for composing multi-block MCP responses.
This is the recommended standalone function for building rich responses with UI blocks, LLM hints, and system rules. It keeps the handler's ctx pure — no framework methods injected.
For simple responses, continue using success and error. Use response() when you need JIT context, UI blocks, or domain rules.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | object | A string message or any JSON-serializable object |
Returns
A new ResponseBuilder for chaining
Example
typescript
import { response, ui } from '@vinkius-core/mcp-fusion';
// Simple (equivalent to success())
return response('Task created').build();
// Rich multi-block response
return response(sprintData)
.uiBlock(ui.echarts(burndownConfig))
.llmHint('Summarize the sprint progress analytically.')
.systemRules(['Use tables for task lists.'])
.build();See
- ResponseBuilder for all available methods
- Presenter for automatic response composition