MCPcopy Create free account
hub / github.com/vercel/examples / think

Function think

python/vibe-coding-ide/backend/src/agent/tools/core.py:10–38  ·  view source on GitHub ↗

Record a concise plan for the current task. Use this before non-trivial changes to outline intent (1-3 sentences). Keep it brief and high-signal; do not include secrets, urls, or sensitive data. Args: thoughts: Short plan or reasoning to log. Returns: The recorded p

(ctx: RunContextWrapper[IDEContext], thoughts: str)

Source from the content-addressed store, hash-verified

8
9@function_tool
10async def think(ctx: RunContextWrapper[IDEContext], thoughts: str) -> str:
11 """Record a concise plan for the current task.
12
13 Use this before non-trivial changes to outline intent (1-3 sentences).
14 Keep it brief and high-signal; do not include secrets, urls, or sensitive data.
15
16 Args:
17 thoughts: Short plan or reasoning to log.
18 Returns:
19 The recorded plan text.
20 """
21 tool_id = f"tc_{len(ctx.context.events) + 1}"
22 ctx.context.events.append(
23 {
24 "phase": "started",
25 "tool_id": tool_id,
26 "name": "think",
27 "arguments": {"thoughts": thoughts},
28 }
29 )
30 ctx.context.events.append(
31 {
32 "phase": "completed",
33 "tool_id": tool_id,
34 "name": "think",
35 "output_data": thoughts,
36 }
37 )
38 return thoughts
39
40
41def _perform_edit_code(file_content: str, args: dict[str, Any]) -> dict[str, Any]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected