Read a single metamethod off an object's raw metatable
get-metamethodRead a specific metamethod from any Luau object's raw metatable, bypassing __metatable locks, and dump function details, constants, and upvalues.
Instructions
Resolve a Luau expression to ANY value (table, Instance, userdata, etc.), grab its raw metatable via getrawmetatable (bypassing __metatable locks), and read ONE named metamethod from it (e.g. __index, __namecall, __newindex, __call, __tostring). When the metamethod is a function this deep-dumps it: its info (Lua/C, source, line, params, upvalue count via getinfo) PLUS its constants (getconstants) and upvalues (getupvalues). This is the targeted counterpart to get-metatable: use it to drill into the exact function Roblox's security layer routes through — for example reading __namecall off getrawmetatable(game) to find the C closure that backs FireServer/InvokeServer, then inspecting its constants for method-name strings. For non-function metamethods (locked __metatable strings, __index tables, etc.) it returns the encoded value. Requires getrawmetatable; getconstants/getupvalues are best-effort (omitted if the executor lacks them or the metamethod is a C closure). Returns { Target, Method, Type, Function?, Constants?, Upvalues?, Value? } or { error } when there is no metatable, the method is absent, or getrawmetatable is missing. Signature: { objectPath: string, method: string, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client, resolved-target. Capabilities: getrawmetatable. Produces: structured-observation. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | Name of the metamethod key to read from the raw metatable, e.g. '__index', '__namecall', '__newindex', '__call', '__tostring', '__metatable'. Read off the metatable as mt[method] (does NOT invoke it). | |
| objectPath | Yes | Luau expression resolving to the object whose metatable holds the metamethod, e.g. 'game', 'game.Players.LocalPlayer', 'getrawmetatable(game)', or 'getgenv().SomeProxy'. Evaluated as `return <objectPath>`. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |