Skip to main content
Glama
Stellify-Software-Ltd

Stellify MCP Server

Official

add_method_body

Append new PHP code statements to an existing method while correctly handling nested constructs like arrow functions and computed properties. Specify file, method, and code; optionally provide TypeScript types for variables.

Instructions

Append code to an existing method. Use this when you need to ADD MORE code to a method that already has statements.

For new methods: Use create_method with the body parameter instead - it creates the method with code in one call.

Nested code is handled correctly. The parser tracks brace/bracket/paren depth and only splits on semicolons at the top level. Arrow functions with block bodies, computed properties, and other nested constructs work as single statements.

Pass 'types' to specify TypeScript types for variables declared in the code.

IMPORTANT: This APPENDS to existing method statements. To REPLACE a method's code entirely:

  1. Create a NEW method with create_method (with body parameter)

  2. Update the file's 'data' array to include new method UUID (remove old one)

  3. Update any element click handlers to reference the new method UUID

  4. Delete the old method with delete_method

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesUUID of the file containing the method
methodYesUUID of the method to add code to
codeYesPHP code for the method body (just the statements, no function declaration). Example: "return $a + $b;"
typesNoMap of variable names to their base TypeScript types (e.g., { "result": "Todo" }). The assembler infers full types from code structure.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries full burden. It discloses appending behavior, nested code handling (brace depth), and contrasts with replacement scenario. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections and front-loaded purpose. Slightly verbose with the replacement steps, but each sentence adds value. Minor conciseness improvement possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description covers all necessary context: when to use, behavior, parameter details, and alternative workflows. Complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds significant value: for 'code' it specifies PHP code, statements only, and provides an example; for 'types' it explains map of variable names and assembler inference. Enhances schema meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Append code to an existing method' with a specific verb and resource. It distinguishes itself from sibling tools like 'create_method' which is for new methods, making the purpose clear and unique.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use (adding more code to an existing method) and when-not-to-use (new methods should use 'create_method'). Also offers a detailed alternative for replacing code entirely, giving complete guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/Stellify-Software-Ltd/stellify-mcp'

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