Skip to content

[Request]: Make the minimal handler example directly retrievable from function capability discovery #1106

Closed

Description

@jimhoyd

Problem or use case

In the 2026-09-30 CLI-only authoring comparison on packed main 5dcf4bb75beba3a9126394aeb799506fdba3c925, an inventory-service agent reported needing to materialize a cookbook example to determine the function signature and how declared arguments reach the handler. It eventually delivered 38/38 HTTP acceptance checks, so this is discovery friction, not a runtime failure or proof that the whole elapsed time was caused by this gap.

Independently reproduced after the batch: urlcode capabilities function --json returns 4,421 bytes with configuration schema, constraints, targets, recipe references and cookbook YAML references, but no executable JS handler signature/snippet. The response does link examples; this is not a claim that examples or documentation are absent from the package.

A basic authoring question requires joining the declaration with its callable code:

/hello:
  methods: [GET]
  function:
    source: functions/hello.mjs
    args: {name: world}

The agent needs the matching public (request, context) / context.args handler contract, not another list of YAML fields. Related evidence program: #1098; existing broader guidance consolidation: #1095.

Proposed behavior and alternatives

Make a bounded, exact-version paired YAML/JavaScript example immediately retrievable from function capability discovery, either inline or by an explicit one-step existing tool/CLI retrieval. Cover the default export and declared args without requiring an entire cookbook to be written into the project. Reuse an authoritative executable recipe so there is no second handwritten contract; keep CLI and authoring MCP consistent.

Preserve target refusals, trust-mode limits and credential withholding. Do not imply arbitrary npm imports work in the sandbox, automatically alter operator grants, or add a new adapter registry. Verify the snippet against the packed consumer and test that the bounded response points to or includes the actual handler source. No new public framework semantics are requested.

Activity

  1. jimhoyd commented on Sep 30, 2026

    @jimhoyd
    CollaboratorAuthor

    Taking this: coordinator session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions