generate_emacs_lisp_code
Automate Emacs tasks by generating Elisp code for specified purposes using the Emacs MCP Server. Simplify interaction and control within Emacs through AI-driven code creation.
Instructions
Generate Emacs Lisp code for the given purpose.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| purpose | Yes |
Implementation Reference
- emacs_mcp_server.py:53-57 (handler)The primary handler function for the 'generate_emacs_lisp_code' MCP tool. It is registered via the @mcp.tool() decorator and delegates execution to the helper function after logging.@log_execution @mcp.tool() def generate_emacs_lisp_code(purpose: str) -> str: """Generate Emacs Lisp code for the given purpose.""" return generate_emacs_lisp_code_from_llm(purpose)
- emacs_mcp_server.py:39-50 (helper)Supporting helper function decorated with @llmify to generate Emacs Lisp code using an LLM, based on the provided purpose.@log_execution @llmify def generate_emacs_lisp_code_from_llm(purpose: str): """Generate Emacs Lisp code for the following purpose: {{ purpose }}. Make sure to include a docstring in the code, and insert explanatory comments. MAKE SURE TO ONLY RETURN THE CODE, DO NOT RETURN ANY EXPLANATION OR ADDITIONAL TEXT. DO NOT WRAP THE CODE IN MARKDOWN CODE BLOCKS. """ pass