Skip to main content
Glama

entry_define_function

Define or redefine reusable functions (custom blocks) with parameters, local variables, and return values for Entry block-coding scripts.

Instructions

함수(나만의 블록) 정의/재정의. 블록 모드용. params: ['이름', ...] 또는 [{name, type:'string'|'boolean'}] (문자/숫자 값 또는 판단 값). {label:'텍스트'}를 끼우면 블록 모양 중간에 글자 삽입. body: compact 블록 배열. 본문에서 매개변수는 {"type":"param","name":"h"}로 참조. kind='value'면 값 반환 함수: return_value에 반환할 값/블록. local_variables: ['i', ...] 함수 지역변수 → 본문에서 {"type":"local_get","name":"i"}, {"type":"local_set","name":"i","value":0}. 호출: 스크립트에서 {"type":"call","function":"함수이름","params":[인자...]}. (엔트리파이썬에서는 entry_set_script의 python 안에 def 함수(인자): 를 쓰면 일반 함수가 자동 생성됩니다)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "entry_define_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNo
kindNo
nameYes
paramsNo
return_valueNo
local_variablesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description has to carry the behavioral load, and it does disclose that this is a define/redefine operation (implying an existing same-named function is overwritten) and explains the resulting runtime contract: how params are referenced via {"type":"param"}, how locals are read/written, how value-functions return, and how the function is invoked with {"type":"call"}. It does not state what define returns, what happens to call sites if a signature changes, or any error behavior on invalid body blocks.

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?

Purpose is front-loaded in the first sentence and each subsequent line carries distinct information for a genuinely complex six-parameter tool. The telegraphic, parenthesis-heavy syntax and the trailing Python aside make it slightly harder to scan than it needs to be, but little is redundant.

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

Completeness4/5

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

For a mutation tool with no annotations, no output schema, and zero schema descriptions, the definition covers the authoring model thoroughly enough to construct a valid call. Remaining gaps are response/persistence behavior and the consequences of redefining an existing function, which an agent would want to know before overwriting.

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 description coverage is 0% across six parameters, so the description must compensate, and it does: it documents the three accepted shapes for params, the compact-block-array format for body, the meaning of kind='value' tied to return_value, and the local_variables contract. Only 'name' is left implicit, and the call example ('function':'함수이름') makes its role clear.

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 opening line gives a specific verb and resource ('함수(나만의 블록) 정의/재정의') plus the operating mode ('블록 모드용'), so an agent knows this creates or overwrites a custom block. It also names the concrete alternative path (defining a function via entry_set_script's python block), which separates it from that sibling.

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

Usage Guidelines4/5

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

The closing parenthetical tells the agent that in Entry Python mode a plain 'def' inside entry_set_script auto-generates a function, which is a real when-to-use-this-instead signal. There is no explicit 'do not use when' clause or note about prerequisites such as needing an open project, so it stops short of a full routing guide.

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