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
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | ||
| kind | No | ||
| name | Yes | ||
| params | No | ||
| return_value | No | ||
| local_variables | No |