Emperor555 Claude commited on
Commit
d26d845
Β·
1 Parent(s): d4d880a

Remove false MCP claims - be honest about tool usage

Browse files

The hackathon allows "MCP tools, vibe coding, or traditional development"
We're using traditional API calls, not actual MCP protocol.

Changed:
- "MCP-Powered" β†’ "AI Agent with Tool Orchestration"
- "MCP Tools Invoked" β†’ "Agent Tool Calls"
- "MCP Execution Trace" β†’ "Execution Trace"
- Removed "All tools follow MCP standard" claim
- Updated tool descriptions to show actual APIs used

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (2) hide show
  1. app.py +8 -9
  2. src/agent.py +19 -19
app.py CHANGED
@@ -33,14 +33,13 @@ def format_sources(sources: list[dict]) -> str:
33
 
34
 
35
  def format_mcp_tools(tools: list[dict]) -> str:
36
- """Format MCP tools used as markdown."""
37
  if not tools:
38
  return "*No tools used*"
39
 
40
- md = "**πŸ”Œ MCP Tools Invoked:**\n\n"
41
  for tool in tools:
42
  md += f"| {tool['icon']} | `{tool['name']}` | {tool['desc']} |\n"
43
- md += "\n*All tools follow the Model Context Protocol (MCP) standard*"
44
  return md
45
 
46
 
@@ -106,8 +105,8 @@ def explain_topic(topic: str, persona_name: str, audience: str = "", generate_au
106
  with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as f:
107
  f.write(audio_bytes)
108
  audio_path = f.name
109
- # Add text_to_speech MCP tool
110
- mcp_tools.append({"name": "text_to_speech", "icon": "πŸ”Š", "desc": "MCP tool for audio generation (ElevenLabs)"})
111
  progress(1.0, desc="Done!")
112
  except Exception as e:
113
  steps_log.append(f"**⚠️ Audio generation failed**\n{str(e)}")
@@ -134,11 +133,11 @@ def create_app():
134
  gr.Markdown(
135
  """
136
  # 🎭 Explainor
137
- ### *An MCP-Powered AI Agent*
138
 
139
  **Learn anything through the voice of your favorite characters!**
140
 
141
- This agent uses **Model Context Protocol (MCP)** tools to: research your topic,
142
  extract key facts, transform explanations into character voices, and generate audio.
143
  """
144
  )
@@ -209,7 +208,7 @@ def create_app():
209
 
210
  with gr.Row():
211
  with gr.Column():
212
- with gr.Accordion("πŸ”Œ MCP Tool Calls", open=True):
213
  mcp_output = gr.Markdown("")
214
 
215
  with gr.Row():
@@ -218,7 +217,7 @@ def create_app():
218
  sources_output = gr.Markdown("")
219
 
220
  with gr.Column():
221
- with gr.Accordion("🧠 MCP Execution Trace", open=False):
222
  steps_output = gr.Markdown("")
223
 
224
  # Example topics
 
33
 
34
 
35
  def format_mcp_tools(tools: list[dict]) -> str:
36
+ """Format tools used as markdown."""
37
  if not tools:
38
  return "*No tools used*"
39
 
40
+ md = "**πŸ”Œ Agent Tool Calls:**\n\n"
41
  for tool in tools:
42
  md += f"| {tool['icon']} | `{tool['name']}` | {tool['desc']} |\n"
 
43
  return md
44
 
45
 
 
105
  with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as f:
106
  f.write(audio_bytes)
107
  audio_path = f.name
108
+ # Add text_to_speech tool
109
+ mcp_tools.append({"name": "text_to_speech", "icon": "πŸ”Š", "desc": "Audio generation via ElevenLabs API"})
110
  progress(1.0, desc="Done!")
111
  except Exception as e:
112
  steps_log.append(f"**⚠️ Audio generation failed**\n{str(e)}")
 
133
  gr.Markdown(
134
  """
135
  # 🎭 Explainor
136
+ ### *AI Agent with Tool Orchestration*
137
 
138
  **Learn anything through the voice of your favorite characters!**
139
 
140
+ This agent orchestrates multiple tools to: research your topic,
141
  extract key facts, transform explanations into character voices, and generate audio.
142
  """
143
  )
 
208
 
209
  with gr.Row():
210
  with gr.Column():
211
+ with gr.Accordion("πŸ”Œ Agent Tool Calls", open=True):
212
  mcp_output = gr.Markdown("")
213
 
214
  with gr.Row():
 
217
  sources_output = gr.Markdown("")
218
 
219
  with gr.Column():
220
+ with gr.Accordion("🧠 Execution Trace", open=False):
221
  steps_output = gr.Markdown("")
222
 
223
  # Example topics
src/agent.py CHANGED
@@ -198,8 +198,8 @@ Now explain "{topic}" in your unique voice and style. Make it fun and educationa
198
  }
199
 
200
 
201
- def format_mcp_call(tool_name: str, inputs: dict, output_summary: str) -> str:
202
- """Format a tool call in MCP style for display."""
203
  import json
204
  return f"""```json
205
  {{
@@ -212,16 +212,16 @@ def format_mcp_call(tool_name: str, inputs: dict, output_summary: str) -> str:
212
 
213
 
214
  def run_agent(topic: str, persona_name: str, audience: str = "") -> Generator[dict, None, None]:
215
- """Run the full agent pipeline using MCP tool pattern.
216
 
217
  Yields progress updates and final results.
218
  """
219
- # MCP Tool 1: web_search
220
  yield {
221
  "type": "step",
222
  "step": "research",
223
- "title": "πŸ”§ MCP Tool: `web_search`",
224
- "content": format_mcp_call("web_search", {"query": topic, "max_results": 5}, "Searching..."),
225
  }
226
 
227
  research, sources = research_topic(topic)
@@ -229,20 +229,20 @@ def run_agent(topic: str, persona_name: str, audience: str = "") -> Generator[di
229
  yield {
230
  "type": "step",
231
  "step": "research_done",
232
- "title": "βœ… Tool Response: `web_search`",
233
- "content": format_mcp_call("web_search", {"query": topic}, f"Found {len(sources)} sources"),
234
  "sources": sources,
235
  }
236
 
237
- # MCP Tool 2: extract_facts
238
  yield {
239
  "type": "step",
240
  "step": "extracting",
241
- "title": "πŸ”§ MCP Tool: `extract_facts`",
242
- "content": format_mcp_call("extract_facts", {"text": f"[{len(sources)} source documents]", "max_facts": 5}, "Extracting key facts..."),
243
  }
244
 
245
- # Step 2: Generate explanation
246
  persona = get_persona(persona_name)
247
 
248
  # Build audience context
@@ -250,12 +250,12 @@ def run_agent(topic: str, persona_name: str, audience: str = "") -> Generator[di
250
  if audience and audience.strip():
251
  audience_context = f"\nYou are explaining this to: {audience.strip()}. Tailor your explanation appropriately for them."
252
 
253
- # MCP Tool 3: persona_transform
254
  yield {
255
  "type": "step",
256
  "step": "generating",
257
- "title": "πŸ”§ MCP Tool: `persona_transform`",
258
- "content": format_mcp_call(
259
  "persona_transform",
260
  {
261
  "persona": persona_name,
@@ -293,11 +293,11 @@ Now explain "{topic}" in your unique {persona_name} voice and style. Make it fun
293
 
294
  explanation = call_llm(messages)
295
 
296
- # Track MCP tools used in pipeline
297
  mcp_tools = [
298
- {"name": "web_search", "icon": "πŸ”", "desc": "MCP tool for web research via DuckDuckGo"},
299
- {"name": "extract_facts", "icon": "πŸ“‹", "desc": "MCP tool for key fact extraction"},
300
- {"name": "persona_transform", "icon": "🎭", "desc": "MCP tool for persona-based explanation (Nebius LLM)"},
301
  ]
302
 
303
  yield {
 
198
  }
199
 
200
 
201
+ def format_tool_call(tool_name: str, inputs: dict, output_summary: str) -> str:
202
+ """Format a tool call for display."""
203
  import json
204
  return f"""```json
205
  {{
 
212
 
213
 
214
  def run_agent(topic: str, persona_name: str, audience: str = "") -> Generator[dict, None, None]:
215
+ """Run the full agent pipeline with tool orchestration.
216
 
217
  Yields progress updates and final results.
218
  """
219
+ # Tool 1: web_search (DuckDuckGo)
220
  yield {
221
  "type": "step",
222
  "step": "research",
223
+ "title": "πŸ”§ Tool: `web_search`",
224
+ "content": format_tool_call("web_search", {"query": topic, "max_results": 5}, "Searching..."),
225
  }
226
 
227
  research, sources = research_topic(topic)
 
229
  yield {
230
  "type": "step",
231
  "step": "research_done",
232
+ "title": "βœ… Response: `web_search`",
233
+ "content": format_tool_call("web_search", {"query": topic}, f"Found {len(sources)} sources"),
234
  "sources": sources,
235
  }
236
 
237
+ # Tool 2: extract_facts
238
  yield {
239
  "type": "step",
240
  "step": "extracting",
241
+ "title": "πŸ”§ Tool: `extract_facts`",
242
+ "content": format_tool_call("extract_facts", {"text": f"[{len(sources)} source documents]", "max_facts": 5}, "Extracting key facts..."),
243
  }
244
 
245
+ # Generate explanation
246
  persona = get_persona(persona_name)
247
 
248
  # Build audience context
 
250
  if audience and audience.strip():
251
  audience_context = f"\nYou are explaining this to: {audience.strip()}. Tailor your explanation appropriately for them."
252
 
253
+ # Tool 3: persona_transform (Nebius LLM)
254
  yield {
255
  "type": "step",
256
  "step": "generating",
257
+ "title": "πŸ”§ Tool: `persona_transform`",
258
+ "content": format_tool_call(
259
  "persona_transform",
260
  {
261
  "persona": persona_name,
 
293
 
294
  explanation = call_llm(messages)
295
 
296
+ # Track tools used in pipeline
297
  mcp_tools = [
298
+ {"name": "web_search", "icon": "πŸ”", "desc": "Web research via DuckDuckGo API"},
299
+ {"name": "extract_facts", "icon": "πŸ“‹", "desc": "Key fact extraction from sources"},
300
+ {"name": "persona_transform", "icon": "🎭", "desc": "Persona explanation via Nebius LLM"},
301
  ]
302
 
303
  yield {