Skip to main content
Glama

Serena MCP Server

by lin2000wl

replace_symbol_body

Updates the body of a specified symbol by providing a new code section, using the name path of the symbol and the relative file path. Ensures proper indentation and direct symbol definition in the new body.

Instructions

Replaces the body of the symbol with the given name_path.

Input Schema

NameRequiredDescriptionDefault
bodyYesThe new symbol body. Important: Begin directly with the symbol definition and provide no leading indentation for the first line (but do indent the rest of the body according to the context).
name_pathYesFor finding the symbol to replace, same logic as in the `find_symbol` tool.
relative_pathYesThe relative path to the file containing the symbol.

Input Schema (JSON Schema)

{ "properties": { "body": { "description": "The new symbol body. Important: Begin directly with the symbol definition and provide no\nleading indentation for the first line (but do indent the rest of the body according to the context).", "title": "Body", "type": "string" }, "name_path": { "description": "For finding the symbol to replace, same logic as in the `find_symbol` tool.", "title": "Name Path", "type": "string" }, "relative_path": { "description": "The relative path to the file containing the symbol.", "title": "Relative Path", "type": "string" } }, "required": [ "name_path", "relative_path", "body" ], "title": "applyArguments", "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lin2000wl/Serena-cursor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server