MCPcopy Create free account
hub / github.com/FastLED/FastLED / list_examples

Function list_examples

mcp_server.py:1542–1567  ·  view source on GitHub ↗

List available FastLED examples.

(
    arguments: dict[str, Any], project_root: Path
)

Source from the content-addressed store, hash-verified

1540
1541
1542async def list_examples(
1543 arguments: dict[str, Any], project_root: Path
1544) -> CallToolResult:
1545 """List available FastLED examples."""
1546 examples_dir = project_root / "examples"
1547
1548 if not examples_dir.exists():
1549 return CallToolResult(
1550 content=[TextContent(type="text", text="Examples directory not found")],
1551 isError=True,
1552 )
1553
1554 examples: list[str] = []
1555 for item in examples_dir.iterdir():
1556 if item.is_dir() and not item.name.startswith("."):
1557 # Check if it has a .ino file
1558 ino_files = list(item.glob("*.ino"))
1559 if ino_files:
1560 examples.append(item.name)
1561
1562 examples.sort()
1563
1564 result_text = f"Available FastLED examples ({len(examples)} total):\n\n"
1565 result_text += "\n".join(f"- {example}" for example in examples)
1566
1567 return CallToolResult(content=[TextContent(type="text", text=result_text)])
1568
1569
1570async def project_info(arguments: dict[str, Any], project_root: Path) -> CallToolResult:

Callers 1

call_toolFunction · 0.85

Calls 3

listClass · 0.85
sortMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected