Skip to main content
Glama

Serena

by oraios

insert_before_symbol

Insert code or content before a specific symbol in a file using name path and relative path. Automatically aligns indentation for seamless integration, ideal for adding classes, functions, imports, or variables.

Instructions

Inserts the given body/content before the beginning of the definition of the given symbol (via the symbol's location). A typical use case is to insert a new class, function, method, field or variable assignment. It also can be used to insert a new import statement before the first symbol in the file.

Input Schema

NameRequiredDescriptionDefault
bodyYesThe body/content to be inserted. Important: the insterted code will automatically have the same indentation as the symbol's body, so you do not need to provide any additional indentation.
name_pathYesFor finding the symbol to insert before, 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 body/content to be inserted. Important: the insterted code will automatically have the\nsame indentation as the symbol's body, so you do not need to provide any additional indentation.", "title": "Body", "type": "string" }, "name_path": { "description": "For finding the symbol to insert before, 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/oraios/serena'

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